You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
1.6 KiB
78 lines
1.6 KiB
const path = require('path')
|
|
// const webpack = require('webpack')
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
module.exports = {
|
|
entry: {
|
|
index: [
|
|
'./examples/index.js',
|
|
],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, './dist'),
|
|
publicPath: '/',
|
|
filename: 'build.js',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.vue$/,
|
|
loader: 'vue-loader',
|
|
},
|
|
{
|
|
test: /\.js$/,
|
|
loader: 'babel-loader', exclude: /node_modules/,
|
|
},
|
|
{
|
|
test: /\.(png|jpg|gif|svg)$/,
|
|
loader: 'file-loader',
|
|
options: {
|
|
name: '[name].[ext]?[hash]',
|
|
},
|
|
},
|
|
{
|
|
test: /\.less$/,
|
|
use: [
|
|
{ loader: 'style-loader' },
|
|
{
|
|
loader: 'css-loader',
|
|
options: { sourceMap: true },
|
|
},
|
|
{ loader: 'less-loader',
|
|
options: { sourceMap: true },
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.js', '.vue'],
|
|
alias: {
|
|
'vue$': 'vue/dist/vue.esm.js',
|
|
'antd': path.join(__dirname, 'components'),
|
|
},
|
|
},
|
|
devServer: {
|
|
port: 3000,
|
|
historyApiFallback: {
|
|
rewrites: [
|
|
{ from: /.*/, to: '/index.html' },
|
|
],
|
|
},
|
|
disableHostCheck: true,
|
|
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
},
|
|
performance: {
|
|
hints: false,
|
|
},
|
|
devtool: '#source-map',
|
|
}
|
|
|
|
module.exports.plugins = (module.exports.plugins || []).concat([
|
|
new HtmlWebpackPlugin({
|
|
template: 'examples/index.html',
|
|
filename: 'index.html',
|
|
inject: true,
|
|
}),
|
|
])
|