1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.createCompiler = createCompiler;
|
7 |
|
8 | var _webpack = require('webpack');
|
9 |
|
10 | var _webpack2 = _interopRequireDefault(_webpack);
|
11 |
|
12 | var _path = require('path');
|
13 |
|
14 | var _path2 = _interopRequireDefault(_path);
|
15 |
|
16 | var _debug = require('debug');
|
17 |
|
18 | var _debug2 = _interopRequireDefault(_debug);
|
19 |
|
20 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21 |
|
22 | var debug = (0, _debug2.default)('cyboard.compiler');
|
23 |
|
24 | function createCompiler(cyboardfile) {
|
25 | var isDev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
26 |
|
27 | var configPath = _path2.default.resolve(__dirname, isDev ? '../config/webpack.config.dev' : '../config/webpack.config.prod');
|
28 |
|
29 | debug('Using wepack config from ' + configPath);
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | var config = require(configPath);
|
37 |
|
38 | config.resolve.alias['injected-boards-config'] = cyboardfile;
|
39 |
|
40 | return (0, _webpack2.default)(config);
|
41 | } |
\ | No newline at end of file |