cleaned up prod, dev, and run for webpack

This commit is contained in:
hak8or 2018-03-01 00:26:51 -05:00
parent 1f49050d69
commit 9b89df3d4b
3 changed files with 1409 additions and 27 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{
"name": "DumbYTManger",
"name": "dumbytmanager",
"version": "0.1.0",
"description": "Front end for the DumbYT Manager project",
"main": "index.js",
@ -12,14 +12,18 @@
"style-loader": "^0.20.2",
"ts-loader": "^4.0.0",
"typescript": "^2.7.2",
"uglifyjs-webpack-plugin": "^1.2.2",
"vue": "^2.5.13",
"vue-loader": "^14.1.1",
"vue-template-compiler": "^2.5.13",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.9"
"webpack-cli": "^2.0.9",
"webpack-dev-server": "^3.1.0"
},
"scripts": {
"build": "webpack",
"start": "webpack-dev-server --mode development --open",
"dev": "webpack --mode development",
"build": "webpack --mode production",
"test": "echo \"Error: no test specified\" && exit 1"
}
}

View File

@ -42,8 +42,8 @@ module.exports = {
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
'style-loader',
'css-loader'
]
}
]
@ -63,24 +63,3 @@ module.exports = {
},
devtool: '#eval-source-map'
}
if (process.env.NODE_ENV === 'production') {
module.exports.devtool = '#source-map'
// http://vue-loader.vuejs.org/en/workflow/production.html
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
compress: {
warnings: false
}
}),
new webpack.LoaderOptionsPlugin({
minimize: true
})
])
}