Skip to content

Commit

Permalink
Merge pull request #6132 from meeseeksmachine/auto-backport-of-pr-613…
Browse files Browse the repository at this point in the history
…1-on-5.7.x

Backport PR #6131 on branch 5.7.x (Switch webpack to production mode)
  • Loading branch information
Zsailer authored Aug 10, 2021
2 parents f9195b2 + f300e92 commit f194d49
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
"scripts": {
"bower": "bower install",
"build": "python setup.py js css",
"build:webpack": "webpack --mode development",
"build:webpack": "webpack --mode production",
"build:watch": "npm run watch",
"watch": "onchange 'notebook/static/**/!(*.min).js' 'notebook/static/**/*.less' 'bower.json' -- npm run build"
},
"devDependencies": {
"@babel/preset-env": "^7.15.0",
"@jupyterlab/apputils": "^3.1.3",
"babel-loader": "^8.2.2",
"babel-polyfill": "^6.26.0",
"bower": "^1.8.8",
"less": "~2",
"onchange": "^6.0.0",
Expand Down
21 changes: 19 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
const path = require('path');

module.exports = {
entry: '@jupyterlab/apputils/lib/sanitizer',
entry: ['babel-polyfill', '@jupyterlab/apputils/lib/sanitizer'],
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'notebook/static/components/sanitizer'),
libraryTarget: "amd"
libraryTarget: "amd",
},
devtool: false,
optimization: {
minimize: false
},
module: {
rules: [
{
test: /\.m?jsx?$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
}
}
}
]
}
}

0 comments on commit f194d49

Please sign in to comment.