Files
smart-table/config/webpack.example.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

2020-01-31 19:39:40 +08:00
const path = require('path');
const merge = require('webpack-merge');
2020-02-01 14:11:20 +08:00
const webpack = require("webpack");
const pkg = require('../package.json');
2020-01-31 19:39:40 +08:00
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const {
CleanWebpackPlugin
} = require('clean-webpack-plugin');
const common = require('./webpack.common.js');
module.exports = merge(common, {
2020-02-08 13:51:13 +08:00
module: {
rules: [{
test: /\.js$/,
exclude: /(node_modules|bower_components)/, //排除掉node_module目录
use: {
loader: 'babel-loader',
options: {
presets: ['env']
}
}
}],
},
2020-01-31 19:39:40 +08:00
plugins: [
new CleanWebpackPlugin(),
2020-02-01 14:11:20 +08:00
new webpack.BannerPlugin(`smartTable v${pkg.version} | (c) pengyajun 2020 | Released under the MIT License.`),
2020-01-31 19:39:40 +08:00
new CopyWebpackPlugin([{
from: "examples/assets",
to: "assets"
}]),
new HtmlWebpackPlugin({
template: path.resolve(__dirname, '../examples/index.html'),
inject: 'head'
})
],
output: {
filename: 'smartTable.min.js',
path: path.resolve(__dirname, '../docs')
},
});