From 07107411a3d728562060c1ee058bbb108e83cfcd Mon Sep 17 00:00:00 2001 From: Daniel J Date: Wed, 22 Jun 2016 16:30:10 +0200 Subject: [PATCH] webpack2 yo --- gulpfile.babel.js | 5 ++++- package.json | 4 ++-- src/eventPage.js | 1 - src/main.js | 1 - webpack.config.babel.js | 8 +++++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index e975065..64fa1df 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -29,8 +29,11 @@ let watchOpts = { } if (inProduction) { + webpackConfig.plugins.push(new webpack.LoaderOptionsPlugin({ + minimize: true, + debug: false + })) webpackConfig.plugins.push(new webpack.optimize.DedupePlugin()) - webpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin(false)) webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false, diff --git a/package.json b/package.json index 9b0476c..04156b9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "babel-core": "^6.9.1", "babel-loader": "^6.2.4", "babel-plugin-transform-strict-mode": "^6.8.0", - "babel-preset-es2015": "^6.9.0", + "babel-preset-es2015-webpack": "^6.4.1", "babel-preset-node6": "^11.0.0", "del": "^2.2.0", "exports-loader": "^0.6.3", @@ -38,7 +38,7 @@ "standard": "^7.1.2", "stylus": "^0.54.5", "stylus-loader": "^2.1.1", - "webpack": "^1.13.1" + "webpack": "^2.1.0-beta.13" }, "standard": { "env": { diff --git a/src/eventPage.js b/src/eventPage.js index 5a8149d..ca2966e 100644 --- a/src/eventPage.js +++ b/src/eventPage.js @@ -1,5 +1,4 @@ /* global chrome, safari */ -'use strict' function fetch (url, cb, type) { if (url.indexOf('//') === 0) { diff --git a/src/main.js b/src/main.js index ec2d554..e784994 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,4 @@ /* global chrome, safari */ -'use strict' import JSZip from 'jszip' import m from 'mithril' diff --git a/webpack.config.babel.js b/webpack.config.babel.js index 145fbe0..7d80b39 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -18,8 +18,7 @@ export default { { test: /\.js$/, loader: 'babel', exclude: /node_modules/, query: { sourceMaps: inProduction, - presets: ['es2015'], - plugins: ['transform-strict-mode'] + presets: ['es2015-webpack'] } }, { @@ -34,7 +33,10 @@ export default { resolve: { extensions: ['', '.js', '.json', '.styl'], - root: [path.join(__dirname, '/src')] + modules: [ + path.resolve('./src'), + 'node_modules' + ] }, plugins: [],