Skip to content

Commit

Permalink
Merge pull request #3211 from jasongrout/webpack
Browse files Browse the repository at this point in the history
Upgrade webpack
  • Loading branch information
jtpio authored Jun 14, 2021
2 parents cd9be77 + d90eabd commit f839d51
Show file tree
Hide file tree
Showing 22 changed files with 443 additions and 1,181 deletions.
8 changes: 4 additions & 4 deletions examples/web1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
},
"devDependencies": {
"chai": "^4.0.0",
"css-loader": "^3.4.0",
"file-loader": "^5.0.2",
"css-loader": "^5.2.6",
"file-loader": "^6.2.0",
"karma": "^4.1.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.1.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"mocha": "^6.1.4",
"style-loader": "^1.1.2",
"webpack": "^4.41.5"
"style-loader": "^2.0.0",
"webpack": "^5.38.1"
}
}
12 changes: 6 additions & 6 deletions examples/web2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"font-awesome": "^4.7.0"
},
"devDependencies": {
"css-loader": "^3.4.0",
"file-loader": "^5.0.2",
"raw-loader": "^4.0.0",
"style-loader": "^1.1.2",
"url-loader": "^3.0.0",
"webpack": "^4.41.5"
"css-loader": "^5.2.6",
"file-loader": "^6.2.0",
"raw-loader": "^4.0.2",
"style-loader": "^2.0.0",
"url-loader": "^4.1.1",
"webpack": "^5.38.1"
}
}
2 changes: 1 addition & 1 deletion examples/web2/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.py$/, loader: 'raw-loader' },
{ test: /\.py$/, use: 'raw-loader' },
// jquery-ui loads some images
{ test: /\.(jpg|png|gif)$/, use: 'file-loader' },
// required to load font-awesome
Expand Down
12 changes: 6 additions & 6 deletions examples/web3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@
"devDependencies": {
"@types/codemirror": "^0.0.74",
"@types/node": "^12.7.0",
"css-loader": "^3.4.0",
"file-loader": "^5.0.2",
"css-loader": "^5.2.6",
"file-loader": "^6.2.0",
"fs-extra": "^8.0.1",
"postcss": "^7.0.17",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-loader": "^5.3.0",
"rimraf": "^2.6.1",
"style-loader": "^1.1.2",
"style-loader": "^2.0.0",
"typescript": "~4.3.2",
"url-loader": "^3.0.0",
"webpack": "^4.41.5"
"url-loader": "^4.1.1",
"webpack": "^5.38.1"
}
}
38 changes: 20 additions & 18 deletions examples/web3/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,26 @@ module.exports = {
{
loader: 'postcss-loader',
options: {
plugins: [
postcss.plugin('delete-tilde', function() {
return function(css) {
css.walkAtRules('import', function(rule) {
rule.params = rule.params.replace('~', '');
});
};
}),
postcss.plugin('prepend', function() {
return function(css) {
css.prepend(
"@import '@jupyter-widgets/controls/css/labvariables.css';"
);
};
}),
require('postcss-import')(),
require('postcss-cssnext')()
]
postcssOptions: {
plugins: [
postcss.plugin('delete-tilde', function() {
return function(css) {
css.walkAtRules('import', function(rule) {
rule.params = rule.params.replace('~', '');
});
};
}),
postcss.plugin('prepend', function() {
return function(css) {
css.prepend(
"@import '@jupyter-widgets/controls/css/labvariables.css';"
);
};
}),
require('postcss-import')(),
require('postcss-cssnext')()
]
}
}
}
]
Expand Down
10 changes: 5 additions & 5 deletions examples/web4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"font-awesome": "^4.7.0"
},
"devDependencies": {
"css-loader": "^3.4.0",
"file-loader": "^5.0.2",
"style-loader": "^1.1.2",
"url-loader": "^3.0.0",
"webpack": "^4.41.5"
"css-loader": "^5.2.6",
"file-loader": "^6.2.0",
"style-loader": "^2.0.0",
"url-loader": "^4.1.1",
"webpack": "^5.38.1"
}
}
40 changes: 32 additions & 8 deletions examples/web4/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
output: {
filename: 'index.built.js',
path: path.resolve(__dirname, 'built'),
publicPath: 'built/'
publicPath: 'built/',
},
module: {
rules: [
Expand All @@ -16,21 +16,45 @@ module.exports = {
// required to load font-awesome
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
use: 'url-loader?limit=10000&mimetype=application/font-woff'
use: {
loader: 'url-loader',
options: {
limit: 10000,
mimetype: 'application/font-woff',
},
},
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
use: 'url-loader?limit=10000&mimetype=application/font-woff'
use: {
loader: 'url-loader',
options: {
limit: 10000,
mimetype: 'application/font-woff',
},
},
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
use: 'url-loader?limit=10000&mimetype=application/octet-stream'
use: {
loader: 'url-loader',
options: {
limit: 10000,
mimetype: 'application/octet-stream',
},
},
},
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
use: 'url-loader?limit=10000&mimetype=image/svg+xml'
}
]
}
use: {
loader: 'url-loader',
options: {
limit: 10000,
mimetype: 'image/svg+xml',
},
},
},
],
},
};
4 changes: 2 additions & 2 deletions packages/base-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^4.0.2",
"karma-webpack": "^5.0.0",
"mocha": "^6.1.4",
"npm-run-all": "^4.1.5",
"rimraf": "^2.6.1",
"sinon": "^7.3.2",
"sinon-chai": "^3.3.0",
"typescript": "~4.3.2",
"webpack": "^4.41.5"
"webpack": "^5.38.1"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 4 additions & 5 deletions packages/base-manager/test/webpack-cov.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ module.exports = {
bail: true,
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.ipynb$/, loader: 'json-loader' },
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.md$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'file?name=[name].[ext]' }
{ test: /\.ipynb$/, use: 'json-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.md$/, use: 'raw-loader' },
{ test: /\.html$/, use: 'file-loader' },
],
preLoaders: [
// instrument only testing sources with Istanbul
Expand Down
8 changes: 4 additions & 4 deletions packages/base-manager/test/webpack.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module.exports = {
bail: true,
module: {
rules: [
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.md$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'file?name=[name].[ext]' },
{ test: /\.ipynb$/, loader: 'json-loader' }
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.md$/, use: 'raw-loader' },
{ test: /\.html$/, use: {loader: 'file-loader', options: { name: '[name].[ext]' } } },
{ test: /\.ipynb$/, use: 'json-loader' }
]
},
mode: 'development'
Expand Down
4 changes: 2 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^4.0.2",
"karma-webpack": "^5.0.0",
"mocha": "^6.1.4",
"npm-run-all": "^4.1.5",
"rimraf": "^2.6.1",
"sinon": "^7.3.2",
"sinon-chai": "^3.3.0",
"typescript": "~4.3.2",
"webpack": "^4.41.5"
"webpack": "^5.38.1"
}
}
7 changes: 3 additions & 4 deletions packages/base/test/webpack-cov.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ module.exports = {
bail: true,
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.ipynb$/, loader: 'json-loader' },
{ test: /\.ipynb$/, use: 'json-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.md$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'file', options: { name: '[name].[ext]' } }
{ test: /\.md$/, use: 'raw-loader' },
{ test: /\.html$/, use: {loader: 'file-loader', options: { name: '[name].[ext]' } } }
],
preLoaders: [
// instrument only testing sources with Istanbul
Expand Down
6 changes: 3 additions & 3 deletions packages/base/test/webpack.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ module.exports = {
module: {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.md$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'file', options: { name: '[name].[ext]' } },
{ test: /\.ipynb$/, loader: 'json-loader' }
{ test: /\.md$/, use: 'raw-loader' },
{ test: /\.html$/, use: {loader: 'file-loader', options: { name: '[name].[ext]' } } },
{ test: /\.ipynb$/, use: 'json-loader' }
]
},
mode: 'development'
Expand Down
15 changes: 7 additions & 8 deletions packages/controls/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,25 @@ module.exports = function(config) {
loader: 'babel?presets[]=es2015'
},
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.json$/, loader: 'json-loader' },
// jquery-ui loads some images
{ test: /\.(jpg|png|gif)$/, loader: 'file' },
{ test: /\.(jpg|png|gif)$/, use: 'file-loader' },
// required to load font-awesome
{
test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff'
use: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/font-woff'
use: 'url-loader?limit=10000&mimetype=application/font-woff'
},
{
test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=application/octet-stream'
use: 'url-loader?limit=10000&mimetype=application/octet-stream'
},
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file' },
{
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
{
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
loader: 'url?limit=10000&mimetype=image/svg+xml'
use: 'url?limit=10000&mimetype=image/svg+xml'
}
]
},
Expand Down
14 changes: 7 additions & 7 deletions packages/controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@types/node": "^12.0.10",
"@types/nouislider": "^9.0.6",
"chai": "^4.0.0",
"css-loader": "^3.4.0",
"css-loader": "^5.2.6",
"expect.js": "^0.3.1",
"file-loader": "^5.0.2",
"file-loader": "^6.2.0",
"istanbul-instrumenter-loader": "^3.0.1",
"karma": "^4.1.0",
"karma-chrome-launcher": "^2.2.0",
Expand All @@ -66,19 +66,19 @@
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-webpack": "^4.0.2",
"karma-webpack": "^5.0.0",
"mocha": "^6.1.4",
"npm-run-all": "^4.1.5",
"postcss-cli": "^6.1.2",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-loader": "^5.3.0",
"rimraf": "^2.6.1",
"sinon": "^7.3.2",
"sinon-chai": "^3.3.0",
"style-loader": "^1.1.2",
"style-loader": "^2.0.0",
"typescript": "~4.3.2",
"url-loader": "^3.0.0",
"webpack": "^4.41.5"
"url-loader": "^4.1.1",
"webpack": "^5.38.1"
}
}
7 changes: 3 additions & 4 deletions packages/controls/test/webpack-cov.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ module.exports = {
bail: true,
module: {
loaders: [
{ test: /\.json$/, loader: 'json-loader' },
{ test: /\.ipynb$/, loader: 'json-loader' },
{ test: /\.ipynb$/, use: 'json-loader' },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.md$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'file', options: { name: '[name].[ext]' } }
{ test: /\.md$/, use: 'raw-loader' },
{ test: /\.html$/, use: {loader: 'file-loader', options: { name: '[name].[ext]' } } }
],
preLoaders: [
// instrument only testing sources with Istanbul
Expand Down
2 changes: 1 addition & 1 deletion packages/controls/test/webpack.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
rules: [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
{ test: /\.md$/, loader: 'raw-loader' },
{ test: /\.html$/, loader: 'file', options: { name: '[name].[ext]' } },
{ test: /\.html$/, use: {loader: 'file-loader', options: { name: '[name].[ext]' } } },
{ test: /\.ipynb$/, loader: 'json-loader' }
]
},
Expand Down
Loading

0 comments on commit f839d51

Please sign in to comment.