Skip to content

Commit 442a7ea

Browse files
author
liuhaocheng.leo
committed
feat(demo): webpack 5 compact
1 parent 9faeaf4 commit 442a7ea

3 files changed

Lines changed: 7 additions & 10 deletions

File tree

demo/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"name": "demo",
3-
"version": "0.0.1",
4-
"scripts": {
5-
"build": "webpack"
6-
}
3+
"version": "0.0.1"
74
}

demo/webpack.config.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,27 @@ const InlineSourceWebpackPlugin = require('../index');
44

55
module.exports = {
66
entry: {
7-
index: './src/index',
8-
bundle: './src/bundle'
7+
index: './demo/src/index.js',
8+
bundle: './demo/src/bundle.js'
99
},
1010
output: {
1111
path: path.resolve(__dirname, 'dist'),
1212
publicPath: '/inline-source-webpack-plugin/demo/dist/',
1313
filename: '[name].[contenthash].js'
1414
},
1515
optimization: {
16-
namedChunks: true,
1716
runtimeChunk: 'single'
1817
},
1918
plugins: [
2019
new HtmlWebpackPlugin({
2120
filename: 'index.html',
22-
template: './src/index.html',
21+
template: './demo/src/index.html',
2322
inject: 'body',
2423
chunks: ['runtime', 'index']
2524
}),
2625
new InlineSourceWebpackPlugin({
2726
compress: true,
28-
rootpath: './src',
27+
rootpath: './demo/src',
2928
noAssetMatch: 'warn'
3029
})
3130
],

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"index.js"
88
],
99
"scripts": {
10-
"test": "jest --runInBand"
10+
"test": "jest --runInBand",
11+
"build:demo": "webpack --config ./demo/webpack.config.js"
1112
},
1213
"repository": {
1314
"type": "git",

0 commit comments

Comments
 (0)