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.
30 lines
647 B
30 lines
647 B
2 years ago
|
const path = require('path');
|
||
|
const { config } = require('process');
|
||
|
|
||
|
const resolve = (dir) => path.join(__dirname, dir);
|
||
|
|
||
|
module.exports = {
|
||
|
pages: {
|
||
|
index: {
|
||
|
entry: 'examples/main.ts', // 入口文件
|
||
|
template: 'public/index.html',
|
||
|
filename: 'index.html',
|
||
|
},
|
||
|
},
|
||
|
|
||
|
chainWebpack: (config) => {
|
||
|
config.module
|
||
|
.rule('js')
|
||
|
.include.add(resolve('packages'))
|
||
|
.end()
|
||
|
.use('babel') // 编译器
|
||
|
.loader('babel-loader')
|
||
|
.tap((option) => {
|
||
|
return option;
|
||
|
});
|
||
|
config.resolve.alias
|
||
|
.set('noob', resolve('packages'))
|
||
|
.set('plugs', resolve('plugs'));
|
||
|
},
|
||
|
};
|