mirror of
https://github.com/abhijithvijayan/web-extension-starter.git
synced 2026-01-30 09:48:12 +01:00
fix: webpack loaders and plugins api changes
This commit is contained in:
parent
3a8d9da2df
commit
4be1fd69ce
@ -109,11 +109,18 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
loader: 'postcss-loader', // For autoprefixer
|
loader: 'postcss-loader',
|
||||||
options: {
|
options: {
|
||||||
ident: 'postcss',
|
postcssOptions: {
|
||||||
// eslint-disable-next-line global-require
|
plugins: [
|
||||||
plugins: [require('autoprefixer')()],
|
[
|
||||||
|
'autoprefixer',
|
||||||
|
{
|
||||||
|
// Options
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'resolve-url-loader', // Rewrites relative paths in url() statements
|
'resolve-url-loader', // Rewrites relative paths in url() statements
|
||||||
@ -146,29 +153,33 @@ module.exports = {
|
|||||||
template: path.join(viewsPath, 'popup.html'),
|
template: path.join(viewsPath, 'popup.html'),
|
||||||
inject: 'body',
|
inject: 'body',
|
||||||
chunks: ['popup'],
|
chunks: ['popup'],
|
||||||
|
hash: true,
|
||||||
filename: 'popup.html',
|
filename: 'popup.html',
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
template: path.join(viewsPath, 'options.html'),
|
template: path.join(viewsPath, 'options.html'),
|
||||||
inject: 'body',
|
inject: 'body',
|
||||||
chunks: ['options'],
|
chunks: ['options'],
|
||||||
|
hash: true,
|
||||||
filename: 'options.html',
|
filename: 'options.html',
|
||||||
}),
|
}),
|
||||||
// write css file(s) to build folder
|
// write css file(s) to build folder
|
||||||
new MiniCssExtractPlugin({filename: 'css/[name].css'}),
|
new MiniCssExtractPlugin({filename: 'css/[name].css'}),
|
||||||
// copy static assets
|
// copy static assets
|
||||||
new CopyWebpackPlugin([{from: 'source/assets', to: 'assets'}]),
|
new CopyWebpackPlugin({
|
||||||
|
patterns: [{from: 'source/assets', to: 'assets'}],
|
||||||
|
}),
|
||||||
// plugin to enable browser reloading in development mode
|
// plugin to enable browser reloading in development mode
|
||||||
extensionReloaderPlugin,
|
extensionReloaderPlugin,
|
||||||
],
|
],
|
||||||
|
|
||||||
optimization: {
|
optimization: {
|
||||||
|
minimize: true,
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
cache: true,
|
|
||||||
parallel: true,
|
parallel: true,
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
output: {
|
format: {
|
||||||
comments: false,
|
comments: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user