Updates
Former-commit-id: 18249e7b2f568d64429b4453a9507e64c5634d6a [formerly 1dca9ca367cdbe78fde1fbc4ffb191947050a885] [formerly 287797e28367eb5fb6de3af8b1c0b54c317013cd [formerly 9ad231c1b8ab0ba936d8be8a44e71b45d51c2f78]] Former-commit-id: 0c25a6a88a0cba03408be4d53c867eca910f3f97 [formerly b414f310c3f86e13f081c984355c6b06015f03d3] Former-commit-id: 7eebc725347308574085abd3d866d97085da141a
This commit is contained in:
@@ -2,6 +2,8 @@ var path = require('path')
|
||||
var utils = require('./utils')
|
||||
var config = require('./config')
|
||||
var vueLoaderConfig = require('./vue-loader.conf')
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
var UglifyJS = require('uglify-js')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
@@ -41,11 +43,6 @@ module.exports = {
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: /node_modules/,
|
||||
loader: 'style!css'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
@@ -68,5 +65,25 @@ module.exports = {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
},
|
||||
{
|
||||
from: path.resolve(__dirname, '../node_modules/codemirror/mode/*/*'),
|
||||
to: path.join(config.build.assetsSubDirectory, 'js/codemirror/mode/[name]/[name].js'),
|
||||
transform: function (source, path) {
|
||||
let result = UglifyJS.minify(source.toString('utf8'))
|
||||
if (result.error !== undefined) {
|
||||
return source
|
||||
}
|
||||
return result.code
|
||||
}
|
||||
}
|
||||
])
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user