Implement frontend dependency management

This commit is contained in:
Bálint Bokros
2017-12-11 17:36:49 +01:00
parent b5e3759bed
commit 7e79c22437
9 changed files with 2997 additions and 18 deletions

3
src/app/static/.babelrc Normal file
View File

@ -0,0 +1,3 @@
{
"presets": ["env"]
}

View File

@ -1,3 +1,8 @@
import * as ace from 'brace';
import 'brace/mode/python';
import 'brace/theme/monokai';
import * as showdown from 'showdown';
let ws = new WebSocket('ws://' + document.location.host + '/ws');
let converter = new showdown.Converter();

View File

@ -0,0 +1,16 @@
{
"dependencies": {
"bootstrap": "4.0.0-beta.2",
"brace": "^0.11.0",
"jquery": "^3.2.1",
"popper.js": "^1.12.3",
"showdown": "^1.8.5",
"webpack": "^3.10.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"uglifyjs-webpack-plugin": "^1.1.2"
}
}

View File

@ -0,0 +1,29 @@
const path = require('path');
const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './js/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
}
]
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
'window.$': 'jquery',
}),
new UglifyJsPlugin()
]
};

2938
src/app/static/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -38,12 +38,6 @@
</div>
</div>
<script src="{{ static_url('vendor/js/jquery-3.2.1.min.js') }}" defer></script>
<script src="{{ static_url('vendor/js/popper.min.js') }}" defer></script>
<script src="{{ static_url('vendor/js/bootstrap.min.js') }}" defer></script>
<script src="{{ static_url('vendor/js/highlight.min.js') }} defer"></script>
<script src="{{ static_url('vendor/js/showdown.min.js') }} defer"></script>
<script src="{{ static_url('vendor/js/ace/ace.js') }} defer"></script>
<script src="{{ static_url('ws_listener.js') }}" defer></script>
<script src="{{ static_url('dist/bundle.js') }}" defer></script>
</body>
</html>