1 | 'use strict';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | require('babel-polyfill');
|
7 |
|
8 |
|
9 | require('source-map-support').install();
|
10 |
|
11 |
|
12 | require('babel-register')({
|
13 | presets: ['es2015', 'react', 'stage-0'],
|
14 | plugins: ['add-module-exports']
|
15 | });
|
16 |
|
17 |
|
18 | require('css-modules-require-hook')({
|
19 | extensions: ['.scss'],
|
20 | preprocessCss: function preprocessCss(data, filename) {
|
21 | return require('node-sass').renderSync({
|
22 | data: data,
|
23 | file: filename
|
24 | }).css;
|
25 | },
|
26 | camelCase: true,
|
27 | generateScopedName: '[name]-[local]'
|
28 | });
|
29 |
|
30 |
|
31 | require('asset-require-hook')({
|
32 | name: '/[hash].[ext]',
|
33 | extensions: ['jpg', 'png', 'gif', 'svg'],
|
34 | limit: 25000
|
35 | });
|
36 |
|
37 | var init = require('./lib/common/init'),
|
38 | log = require('./lib/common/log');
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | var devServer = function devServer(options) {
|
49 | log("init server!");
|
50 |
|
51 | init(options);
|
52 |
|
53 | require('./lib/dev/server');
|
54 | };
|
55 |
|
56 | module.exports = devServer; |
\ | No newline at end of file |