Skip to content

Commit

Permalink
Merge pull request #1270 from yyx990803/client-refactor
Browse files Browse the repository at this point in the history
Cleanup client build setup, fix IE<=11 compatibility
  • Loading branch information
sokra committed Jan 14, 2018
2 parents 6689cb8 + 676d590 commit b0fa5f6
Show file tree
Hide file tree
Showing 18 changed files with 273 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .babelrc
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
1 change: 1 addition & 0 deletions .eslintignore
@@ -0,0 +1 @@
web_modules
4 changes: 1 addition & 3 deletions .gitignore
@@ -1,8 +1,6 @@
npm-debug.log
node_modules
/client/live.bundle.js
/client/index.bundle.js
/client/sockjs.bundle.js
/client
/coverage
/ssl/*.pem
.idea/
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions client-src/default/webpack.config.js
@@ -0,0 +1,22 @@
'use strict';

const UglifyJSPlugin = require('uglifyjs-webpack-plugin');

module.exports = {
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules|web_modules/,
use: [
{
loader: 'babel-loader'
}
]
}
]
},
plugins: [
new UglifyJSPlugin()
]
};
2 changes: 1 addition & 1 deletion client/live.js → client-src/live/index.js
Expand Up @@ -4,7 +4,7 @@

const $ = require('jquery');
const stripAnsi = require('strip-ansi');
const socket = require('./socket');
const socket = require('../default/socket');
require('./style.css');

let hot = false;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 8 additions & 5 deletions client/webpack.config.js → client-src/live/webpack.config.js
@@ -1,6 +1,8 @@
'use strict';

const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');

module.exports = {
module: {
Expand All @@ -10,10 +12,7 @@ module.exports = {
exclude: /node_modules|web_modules/,
use: [
{
loader: 'babel-loader',
options: {
presets: ['env']
}
loader: 'babel-loader'
}
]
},
Expand All @@ -33,6 +32,10 @@ module.exports = {
]
},
plugins: [
new UglifyJSPlugin()
new UglifyJSPlugin(),
new CopyPlugin([{
from: path.resolve(__dirname, 'live.html'),
to: path.resolve(__dirname, '../../client/live.html')
}])
]
};
File renamed without changes.
File renamed without changes.
229 changes: 229 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b0fa5f6

Please sign in to comment.