reindent webpack-config, allow absolute paths for including modules, automatically resolve file extensions
This commit is contained in:
@@ -13,63 +13,61 @@ var env = process.env.WEBPACK_ENV;
|
||||
|
||||
// Differ settings based on production flag
|
||||
if (env === 'production') {
|
||||
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
||||
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;
|
||||
|
||||
plugins.push(new UglifyJsPlugin({
|
||||
minimize: true,
|
||||
sourceMap: true
|
||||
}
|
||||
));
|
||||
plugins.push(new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
}
|
||||
));
|
||||
plugins.push(new UglifyJsPlugin({
|
||||
minimize: true,
|
||||
sourceMap: true
|
||||
}
|
||||
));
|
||||
plugins.push(new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
appName = appName + '.js';
|
||||
appName = appName + '.js';
|
||||
} else {
|
||||
appName = appName + '.js';
|
||||
appName = appName + '.js';
|
||||
}
|
||||
|
||||
// Main Settings config
|
||||
module.exports = {
|
||||
entry: [
|
||||
'intersection-observer',
|
||||
'babel-polyfill',
|
||||
entryPoint
|
||||
],
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
path: exportPath,
|
||||
publicPath: '/build',
|
||||
filename: appName
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.(vue|js)$/,
|
||||
loader: 'eslint-loader',
|
||||
exclude: /node_modules/
|
||||
},
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader'
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
presets: ['es2015']
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js'
|
||||
}
|
||||
},
|
||||
plugins
|
||||
entry: [
|
||||
'intersection-observer',
|
||||
'babel-polyfill',
|
||||
entryPoint
|
||||
],
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
path: exportPath,
|
||||
publicPath: '/build',
|
||||
filename: appName
|
||||
},
|
||||
module: {
|
||||
loaders: [{
|
||||
test: /\.(vue|js)$/,
|
||||
loader: 'eslint-loader',
|
||||
exclude: /node_modules/
|
||||
}, {
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader'
|
||||
}, {
|
||||
test: /\.js$/,
|
||||
exclude: /(node_modules|bower_components)/,
|
||||
loader: 'babel-loader',
|
||||
query: {
|
||||
presets: ['es2015']
|
||||
}
|
||||
}]
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js'
|
||||
},
|
||||
modules: [path.resolve(__dirname, "src"), "node_modules"],
|
||||
extensions: [".vue", ".js", ".less"]
|
||||
},
|
||||
plugins
|
||||
};
|
||||
Reference in New Issue
Block a user