mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Add Vue template
This commit is contained in:
47
templates/VueSpa/webpack.config.vendor.js
Normal file
47
templates/VueSpa/webpack.config.vendor.js
Normal file
@@ -0,0 +1,47 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
module.exports = (env) => {
|
||||
const isDevBuild = !(env && env.prod);
|
||||
const extractCSS = new ExtractTextPlugin('vendor.css');
|
||||
return [{
|
||||
stats: { modules: false },
|
||||
resolve: {
|
||||
extensions: [ '.js' ]
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{ test: /\.(png|woff|woff2|eot|ttf|svg)(\?|$)/, use: 'url-loader?limit=100000' },
|
||||
{ test: /\.css(\?|$)/, use: extractCSS.extract({ use: 'css-loader' }) }
|
||||
]
|
||||
},
|
||||
entry: {
|
||||
vendor: [
|
||||
'bootstrap',
|
||||
'bootstrap/dist/css/bootstrap.css',
|
||||
'event-source-polyfill',
|
||||
'isomorphic-fetch',
|
||||
'jquery',
|
||||
'vue',
|
||||
'vue-router'
|
||||
],
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'wwwroot', 'dist'),
|
||||
publicPath: '/dist/',
|
||||
filename: '[name].js',
|
||||
library: '[name]_[hash]',
|
||||
},
|
||||
plugins: [
|
||||
extractCSS,
|
||||
new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable)
|
||||
new webpack.DllPlugin({
|
||||
path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
|
||||
name: '[name]_[hash]'
|
||||
})
|
||||
].concat(isDevBuild ? [] : [
|
||||
new webpack.optimize.UglifyJsPlugin()
|
||||
])
|
||||
}];
|
||||
};
|
||||
Reference in New Issue
Block a user