chore(webpack): Add npm run serve command
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
18
webpack.js
18
webpack.js
@@ -3,6 +3,7 @@ const path = require('path')
|
||||
|
||||
const buildMode = process.env.NODE_ENV
|
||||
const isDev = buildMode === 'development'
|
||||
const isDevServer = process.env.WEBPACK_DEV_SERVER;
|
||||
|
||||
webpackConfig.entry = {
|
||||
...webpackConfig.entry,
|
||||
@@ -13,14 +14,17 @@ webpackConfig.entry = {
|
||||
reference: path.join(__dirname, 'src', 'init-reference.js'),
|
||||
}
|
||||
|
||||
webpackConfig.stats = {
|
||||
context: path.resolve(__dirname, 'src'),
|
||||
assets: true,
|
||||
entrypoints: true,
|
||||
chunks: true,
|
||||
modules: true,
|
||||
if (isDevServer) {
|
||||
webpackConfig.output.publicPath = 'http://127.0.0.1:3000/'
|
||||
} else {
|
||||
webpackConfig.stats = {
|
||||
context: path.resolve(__dirname, 'src'),
|
||||
assets: true,
|
||||
entrypoints: true,
|
||||
chunks: true,
|
||||
modules: true,
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for https://github.com/nextcloud/webpack-vue-config/pull/432 causing problems with nextcloud-vue-collections
|
||||
webpackConfig.resolve.alias = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user