Avoid main.js being generated in dist

when were generating only the CSS
This commit is contained in:
JC Brand 2019-05-10 12:06:32 +02:00
parent 0e7d64818d
commit a276a05094
2 changed files with 8 additions and 5 deletions

View File

@ -11,12 +11,12 @@
"README.md"
],
"scripts": {
"converse.css": "webpack --type=css --mode=development",
"converse.css": "webpack --type=css --mode=development && rm -r tmp",
"converse.min.css": "npm run converse.css && cleancss --skip-rebase dist/converse.css > dist/converse.min.css",
"converse.js": "webpack --mode=development",
"converse.min.js": "npm run converse.js && webpack --mode=production",
"converse-headless.js": "webpack --mode=development --type=headless",
"converse-headless.min.js": "npm run converse-headless.css && webpack --mode=production --type=headless",
"converse-headless.min.js": "npm run converse-headless.js && webpack --mode=production --type=headless",
"clean": "rm -rf node_modules stamp-npm dist *.zip",
"build": "npm run converse.min.css && npm run converse-headless.min.js && npm run converse.min.js",
"prepare": "npm run build"

View File

@ -15,7 +15,7 @@ const config = {
filename: 'converse.js'
},
devtool: 'source-map',
plugins: [new MiniCssExtractPlugin({filename: './converse.css'})],
plugins: [new MiniCssExtractPlugin({filename: '../dist/converse.css'})],
module: {
rules: [
{
@ -60,7 +60,7 @@ const config = {
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
outputPath: './'
outputPath: '../dist/'
}
}
]
@ -184,7 +184,10 @@ function parameterize () {
if (type === 'css') {
console.log("Building only CSS");
config.entry = path.resolve(__dirname, 'sass/converse.scss');
config.output = {};
config.output = {
path: path.resolve(__dirname, 'tmp'),
filename: 'css-builder.js'
}
}
if (mode === 'production') {