count-time-xch
v1.0.0
Published
``` const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CountTimePlugin = require('./plugins/count-time-xch.js')
Downloads
2
Readme
使用说明
webpack.config.js文件
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CountTimePlugin = require('./plugins/count-time-xch.js')
module.exports = {
resolveLoader: {
modules: ['node_modules', 'loaders']
},
entry: {
app: './src/index.js'
},
module: {
rules: [
{
test: /\.md$/,
use: [
{
loader: 'html-loader'
},
{
loader: 'markdown-loader',
options: {}
}
]
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.{png|svg|jpg|gif}$/,
use: [
'file-loader'
]
},
{
test: /\.js$/,
use: [
{
loader: 'replace-loader',
options: {
name: 'abc'
}
}
]
},
{
test: /\.html$/,
use: [
'html-loader'
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
template: './src/views/index.html'
}),
new CountTimePlugin(),
]
};