Browse Source

WIP webpack updates

Jason Grout 7 years ago
parent
commit
e630e3c6ea

+ 1 - 6
dev_mode/webpack.config.js

@@ -102,6 +102,7 @@ JupyterLabPlugin.prototype._first = true;
 
 
 module.exports = {
+  mode: 'development',
   entry: {
     main: ['whatwg-fetch', path.resolve(buildDir, 'index.out.js')],
     vendor: jlab.vendor
@@ -170,12 +171,6 @@ module.exports = {
       title: jlab.name || 'JupyterLab'
     }),
     new webpack.HashedModuleIdsPlugin(),
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'vendor'
-    }),
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'manifest'
-    }),
     new JupyterLabPlugin({})
   ]
 };

+ 2 - 20
dev_mode/webpack.prod.config.js

@@ -1,25 +1,7 @@
-
-var UglifyJSPlugin = require('uglifyjs-webpack-plugin');
 var merge = require('webpack-merge');
-var webpack = require('webpack');
 var common = require('./webpack.config');
 
 module.exports = merge(common, {
-  devtool: 'source-map',
-  plugins: [
-    new UglifyJSPlugin({
-      sourceMap: true,
-      parallel: true,
-      uglifyOptions: {
-        beautify: false,
-        ecma: 6,
-        mangle: true,
-        compress: false,
-        comments: false,
-      }
-    }),
-    new webpack.DefinePlugin({
-      'process.env.NODE_ENV': JSON.stringify('production')
-    })
-  ]
+  mode: 'production',
+  devtool: 'source-map'
 });

+ 1 - 6
jupyterlab/staging/webpack.config.js

@@ -102,6 +102,7 @@ JupyterLabPlugin.prototype._first = true;
 
 
 module.exports = {
+  mode: 'development',
   entry: {
     main: ['whatwg-fetch', path.resolve(buildDir, 'index.out.js')],
     vendor: jlab.vendor
@@ -170,12 +171,6 @@ module.exports = {
       title: jlab.name || 'JupyterLab'
     }),
     new webpack.HashedModuleIdsPlugin(),
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'vendor'
-    }),
-    new webpack.optimize.CommonsChunkPlugin({
-      name: 'manifest'
-    }),
     new JupyterLabPlugin({})
   ]
 };

+ 2 - 20
jupyterlab/staging/webpack.prod.config.js

@@ -1,25 +1,7 @@
-
-var UglifyJSPlugin = require('uglifyjs-webpack-plugin');
 var merge = require('webpack-merge');
-var webpack = require('webpack');
 var common = require('./webpack.config');
 
 module.exports = merge(common, {
-  devtool: 'source-map',
-  plugins: [
-    new UglifyJSPlugin({
-      sourceMap: true,
-      parallel: true,
-      uglifyOptions: {
-        beautify: false,
-        ecma: 6,
-        mangle: true,
-        compress: false,
-        comments: false,
-      }
-    }),
-    new webpack.DefinePlugin({
-      'process.env.NODE_ENV': JSON.stringify('production')
-    })
-  ]
+  mode: 'production',
+  devtool: 'source-map'
 });

+ 1 - 0
packages/theme-dark-extension/webpack.config.js

@@ -2,6 +2,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
 const path = require('path');
 
 module.exports = {
+  mode: 'production',
   entry: {
     index: './style/index.css',
     embed: './style/embed.css'

+ 1 - 0
packages/theme-light-extension/webpack.config.js

@@ -2,6 +2,7 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
 const path = require('path');
 
 module.exports = {
+  mode: 'production',
   entry: {
     index: './style/index.css',
     embed: './style/embed.css'