diff --git a/src/popup/app/app.js b/src/popup/app/app.js index 19401ab9152..4d159c95195 100644 --- a/src/popup/app/app.js +++ b/src/popup/app/app.js @@ -1,4 +1,4 @@ -require('jquery'); +window.$ = window.jQuery = require('jquery'); require('bootstrap'); require('papaparse'); require('clipboard'); diff --git a/webpack.common.js b/webpack.common.js index b3025d9b1a9..cc9d9bc3ece 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -61,11 +61,6 @@ module.exports = { new CleanWebpackPlugin([ path.resolve(__dirname, 'dist/*') ]), - new webpack.ProvidePlugin({ - $: 'jquery', - jQuery: 'jquery', - 'window.jQuery': 'jquery' - }), new webpack.optimize.CommonsChunkPlugin({ name: 'popup/vendor', chunks: ['popup/app'], diff --git a/webpack.prod.js b/webpack.prod.js index 63a67fb7a7a..1eab9fedf59 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -1,6 +1,6 @@ const merge = require('webpack-merge'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); -//const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); +const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); const common = require('./webpack.common.js'); const webpack = require('webpack'); @@ -29,13 +29,9 @@ module.exports = merge(common, { ] }, plugins: [ - // UglifyJS does not support es6 - // ref: https://github.com/webpack/webpack/issues/2972#issuecomment-261705632 - //new UglifyJSPlugin({ - // uglifyOptions: { - // mangle: false - // } - //}), + new UglifyJSPlugin({ + include: ['vendor.js', 'popup/vendor.js'] + }), new webpack.SourceMapDevToolPlugin({ filename: '[name].js.map', include: ['background.js', 'popup/app.js']