-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
28 lines (26 loc) · 829 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const webpack = require('webpack');
const test = require('./config2/base');
const path = require('path');
const projectRoot = path.resolve('./')
const build = require('./config/webpack.build');
class Core{
constructor(param){
this.path = path;
this.globPath = projectRoot; // 获取命令行所在项目路径
this.entrySrc = path.resolve(projectRoot,'./src/app.js');
this.outSrc = path.resolve(projectRoot,'./build');
this.type = param.type;
this.webpack = webpack;
}
run(){
// const webpackfn = webpack(test({
// entry:this.entrySrc,
// outer:this.outSrc
// }))
const webpackfn = webpack(build)
webpackfn.run((err, stats) => {
console.log(err)
})
}
}
module.exports = Core;