...
|
...
|
@@ -32,91 +32,93 @@ shelljs.ls(path.join(__dirname, '../js/**/*.page.js')).forEach((f) => { |
|
|
];
|
|
|
});
|
|
|
|
|
|
module.exports = {
|
|
|
entry: entries,
|
|
|
output: {
|
|
|
path: path.join(__dirname, 'bundle'), // absolute path
|
|
|
filename: '[name].js'
|
|
|
},
|
|
|
module: {
|
|
|
rules: [{
|
|
|
test: /\.vue$/,
|
|
|
use: [{
|
|
|
loader: 'vue-loader',
|
|
|
options: {
|
|
|
postcss: {
|
|
|
plugins: postcssConfig.postcssPlugin('dev'),
|
|
|
parser: scss
|
|
|
},
|
|
|
autoprefixer: false,
|
|
|
loaders: {
|
|
|
css: ExtractTextPlugin.extract({
|
|
|
fallback: 'vue-style-loader',
|
|
|
use: [{
|
|
|
loader: 'css-loader',
|
|
|
options: {
|
|
|
url: false
|
|
|
}
|
|
|
}]
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
}, {
|
|
|
test: /\.js$/,
|
|
|
exclude: [/node_modules/],
|
|
|
use: [{
|
|
|
loader: 'babel-loader'
|
|
|
}]
|
|
|
}, {
|
|
|
test: /\.css$/,
|
|
|
use: ExtractTextPlugin.extract({
|
|
|
fallback: 'style-loader',
|
|
|
module.exports = (env) => {
|
|
|
return {
|
|
|
entry: entries,
|
|
|
output: {
|
|
|
path: path.join(__dirname, 'bundle'), // absolute path
|
|
|
filename: '[name].js'
|
|
|
},
|
|
|
module: {
|
|
|
rules: [{
|
|
|
test: /\.vue$/,
|
|
|
use: [{
|
|
|
loader: 'css-loader',
|
|
|
loader: 'vue-loader',
|
|
|
options: {
|
|
|
url: false
|
|
|
postcss: {
|
|
|
plugins: postcssConfig.postcssPlugin(env),
|
|
|
parser: scss
|
|
|
},
|
|
|
autoprefixer: false,
|
|
|
loaders: {
|
|
|
css: ExtractTextPlugin.extract({
|
|
|
fallback: 'vue-style-loader',
|
|
|
use: [{
|
|
|
loader: 'css-loader',
|
|
|
options: {
|
|
|
url: false
|
|
|
}
|
|
|
}]
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
loader: 'postcss-loader',
|
|
|
}],
|
|
|
}, {
|
|
|
test: /\.js$/,
|
|
|
exclude: [/node_modules/],
|
|
|
use: [{
|
|
|
loader: 'babel-loader'
|
|
|
}]
|
|
|
}, {
|
|
|
test: /\.css$/,
|
|
|
use: ExtractTextPlugin.extract({
|
|
|
fallback: 'style-loader',
|
|
|
use: [{
|
|
|
loader: 'css-loader',
|
|
|
options: {
|
|
|
url: false
|
|
|
}
|
|
|
}, {
|
|
|
loader: 'postcss-loader',
|
|
|
options: {
|
|
|
plugins: postcssConfig.postcssPlugin(env),
|
|
|
parser: scss
|
|
|
}
|
|
|
}],
|
|
|
})
|
|
|
}, {
|
|
|
test: /\.hbs$/,
|
|
|
use: [{
|
|
|
loader: 'handlebars-loader',
|
|
|
options: {
|
|
|
plugins: postcssConfig.postcssPlugin('dev'),
|
|
|
parser: scss
|
|
|
helperDirs: [
|
|
|
path.join(__dirname, '../js/common/helpers')
|
|
|
],
|
|
|
partialDirs: [
|
|
|
path.join(__dirname, '../../doraemon/views/partial')
|
|
|
]
|
|
|
}
|
|
|
}],
|
|
|
})
|
|
|
}, {
|
|
|
test: /\.hbs$/,
|
|
|
use: [{
|
|
|
loader: 'handlebars-loader',
|
|
|
options: {
|
|
|
helperDirs: [
|
|
|
path.join(__dirname, '../js/common/helpers')
|
|
|
],
|
|
|
partialDirs: [
|
|
|
path.join(__dirname, '../../doraemon/views/partial')
|
|
|
]
|
|
|
}
|
|
|
}]
|
|
|
}]
|
|
|
}]
|
|
|
},
|
|
|
resolve: {
|
|
|
modules: ['node_modules', './public/vue', './public/hbs', './public/scss', './public/js'],
|
|
|
alias: {
|
|
|
js: path.join(__dirname, '../js/'),
|
|
|
vue: 'vue/dist/vue.js'
|
|
|
}
|
|
|
},
|
|
|
plugins: [
|
|
|
new ExtractTextPlugin('[name].css'),
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
|
name: 'libs',
|
|
|
filename: 'libs.js'
|
|
|
}),
|
|
|
new webpack.ProvidePlugin({
|
|
|
$: 'yoho-jquery',
|
|
|
jQuery: 'yoho-jquery',
|
|
|
'window.jQuery': 'yoho-jquery'
|
|
|
})
|
|
|
]
|
|
|
}; |
|
|
},
|
|
|
resolve: {
|
|
|
modules: ['node_modules', './public/vue', './public/hbs', './public/scss', './public/js'],
|
|
|
alias: {
|
|
|
js: path.join(__dirname, '../js/'),
|
|
|
vue: 'vue/dist/vue.js'
|
|
|
}
|
|
|
},
|
|
|
plugins: [
|
|
|
new ExtractTextPlugin('[name].css'),
|
|
|
new webpack.optimize.CommonsChunkPlugin({
|
|
|
name: 'libs',
|
|
|
filename: 'libs.js'
|
|
|
}),
|
|
|
new webpack.ProvidePlugin({
|
|
|
$: 'yoho-jquery',
|
|
|
jQuery: 'yoho-jquery',
|
|
|
'window.jQuery': 'yoho-jquery'
|
|
|
})
|
|
|
]
|
|
|
}
|
|
|
}; |
|
|
\ No newline at end of file |
...
|
...
|
|