Userscript template aktualisiert
This commit is contained in:
37
config/webpack.config.dev.cjs
Normal file
37
config/webpack.config.dev.cjs
Normal file
@@ -0,0 +1,37 @@
|
||||
const path = require('path')
|
||||
const { merge } = require('webpack-merge')
|
||||
const LiveReloadPlugin = require('webpack-livereload-plugin')
|
||||
const UserScriptMetaDataPlugin = require('userscript-metadata-webpack-plugin')
|
||||
|
||||
const metadata = require('./metadata.cjs')
|
||||
const webpackConfig = require('./webpack.config.base.cjs')
|
||||
|
||||
metadata.require.push(
|
||||
'file://' + path.resolve(__dirname, '../dist/index.prod.user.js')
|
||||
)
|
||||
|
||||
const cfg = merge(webpackConfig, {
|
||||
entry: {
|
||||
prod: webpackConfig.entry,
|
||||
dev: path.resolve(__dirname, './empty.cjs'),
|
||||
},
|
||||
output: {
|
||||
filename: 'index.[name].user.js',
|
||||
path: path.resolve(__dirname, '../dist'),
|
||||
},
|
||||
devtool: 'inline-source-map',
|
||||
watch: true,
|
||||
watchOptions: {
|
||||
ignored: /node_modules/,
|
||||
},
|
||||
plugins: [
|
||||
new LiveReloadPlugin({
|
||||
delay: 500,
|
||||
}),
|
||||
new UserScriptMetaDataPlugin({
|
||||
metadata,
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
module.exports = cfg
|
||||
Reference in New Issue
Block a user