54 lines
1.1 KiB
JavaScript
54 lines
1.1 KiB
JavaScript
/* eslint-disable no-undef */
|
|
|
|
const { VueLoaderPlugin } = require('vue-loader')
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
module.exports = {
|
|
mode: 'development',
|
|
entry: './demo/main.js',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.vue$/,
|
|
use: 'vue-loader',
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ['style-loader', 'css-loader'],
|
|
},
|
|
{
|
|
test: /\.s[ac]ss$/i,
|
|
use: [
|
|
// 将 JS 字符串生成为 style 节点
|
|
'style-loader',
|
|
// 将 CSS 转化成 CommonJS 模块
|
|
'css-loader',
|
|
// 将 Sass 编译成 CSS
|
|
'sass-loader',
|
|
],
|
|
},
|
|
{
|
|
test: /\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/,
|
|
use: [
|
|
{
|
|
loader: 'url-loader',
|
|
options: {
|
|
limit: 8192,
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{
|
|
test: /\.worker\.js$/,
|
|
loader: 'worker-loader',
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new VueLoaderPlugin(),
|
|
new HtmlWebpackPlugin({
|
|
template: './demo/index.html',
|
|
}),
|
|
],
|
|
}
|