This commit is contained in:
Henrique Dias committed 2017-07-05 18:01:41 +01:00
1 parent 5b3b5aecaf
commit 9ad231c1b8
10 files changed
+120 -488

No files matched your search

+23 -6
View File
@@ -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
}
}
])
]
}
+1 -10
View File
@@ -5,7 +5,6 @@ var webpack = require('webpack')
var config = require('./config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
@@ -65,14 +64,6 @@ module.exports = merge(baseWebpackConfig, {
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
})
]
})
-8
View File
@@ -88,14 +88,6 @@ var webpackConfig = merge(baseWebpackConfig, {
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
]),
// service worker caching
new SWPrecacheWebpackPlugin({
cacheId: 'File Manager',