Skip to content

Cleanup client build setup, fix IE<=11 compatibility #1270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would default to CJS module output no? If so, should we be switching this to "modules":false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client source is still using require, so having modules: false has no effect. Or we can convert to use ES modules imports and enable modules: false, but that may break compat with webpack 2 (not sure if that's still a requirement)

}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web_modules
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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.
13 changes: 8 additions & 5 deletions client/webpack.config.js → client-src/live/webpack.config.js
Original file line number Diff line number Diff line change
@@ -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.

Loading