Updates
This commit is contained in:
10 files changed
+120
-488
No files matched your search
@@ -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