mirror of
https://github.com/kevin-DL/vue-audio-recorder.git
synced 2026-01-11 19:04:28 +00:00
Update package.json & webpack
This commit is contained in:
12
package.json
12
package.json
@@ -5,8 +5,8 @@
|
|||||||
"author": "Gennady Grishkovtsov <grishkovelli@gmail.com>",
|
"author": "Gennady Grishkovtsov <grishkovelli@gmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot --https",
|
"dev": "webpack-dev-server --env.NODE_ENV=development --mode development --open --hot --https",
|
||||||
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
|
"build": "webpack --env.NODE_ENV=production --mode production --progress --hide-modules"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
@@ -26,11 +26,13 @@
|
|||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"node-sass": "^4.5.3",
|
"node-sass": "^4.5.3",
|
||||||
"sass-loader": "^6.0.6",
|
"sass-loader": "^6.0.6",
|
||||||
|
"uglifyjs-webpack-plugin": "^2.0.1",
|
||||||
"vue": "^2.5.16",
|
"vue": "^2.5.16",
|
||||||
"vue-loader": "^13.0.5",
|
"vue-loader": "^14.2.2",
|
||||||
"vue-template-compiler": "^2.4.4",
|
"vue-template-compiler": "^2.4.4",
|
||||||
"webpack": "^3.6.0",
|
"webpack": "^4.17.1",
|
||||||
"webpack-dev-server": "^2.9.1",
|
"webpack-cli": "^3.1.2",
|
||||||
|
"webpack-dev-server": "^3.1.9",
|
||||||
"webpack-merge": "^4.1.3"
|
"webpack-merge": "^4.1.3"
|
||||||
},
|
},
|
||||||
"main": "dist/vue-audio-recorder.min.js",
|
"main": "dist/vue-audio-recorder.min.js",
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const merge = require('webpack-merge')
|
const merge = require('webpack-merge')
|
||||||
const env = `./webpack.${process.env.NODE_ENV === 'production' ? 'prod' : 'dev'}.js`
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
module.exports = merge(require(env), {
|
module.exports = (env, args) => {
|
||||||
|
let conf = `./webpack.${env.NODE_ENV === 'production' ? 'prod' : 'dev'}.js`
|
||||||
|
|
||||||
|
return merge(require(conf), {
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
@@ -65,3 +67,4 @@ module.exports = merge(require(env), {
|
|||||||
hints: false
|
hints: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ const path = require('path')
|
|||||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
devtool: '#eval-source-map',
|
|
||||||
entry: './demo/index.js',
|
entry: './demo/index.js',
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, './demo')
|
path: path.resolve(__dirname, './demo')
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
devtool: '#source-map',
|
entry: {
|
||||||
entry: './src/index.js',
|
main: './src/index.js'
|
||||||
|
},
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, 'dist'),
|
path: path.resolve(__dirname, 'dist'),
|
||||||
filename: 'vue-audio-recorder.min.js',
|
filename: 'vue-audio-recorder.min.js',
|
||||||
@@ -12,18 +14,21 @@ module.exports = {
|
|||||||
libraryExport: 'default',
|
libraryExport: 'default',
|
||||||
umdNamedDefine: true
|
umdNamedDefine: true
|
||||||
},
|
},
|
||||||
|
optimization: {
|
||||||
|
minimizer: [
|
||||||
|
new UglifyJsPlugin({
|
||||||
|
cache: true,
|
||||||
|
parallel: true,
|
||||||
|
sourceMap: true
|
||||||
|
})
|
||||||
|
]
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env': {
|
'process.env': {
|
||||||
NODE_ENV: '"production"'
|
NODE_ENV: '"production"'
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
new webpack.optimize.UglifyJsPlugin({
|
|
||||||
sourceMap: true,
|
|
||||||
compress: {
|
|
||||||
warnings: true
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
new webpack.LoaderOptionsPlugin({
|
new webpack.LoaderOptionsPlugin({
|
||||||
minimize: false
|
minimize: false
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user