-
Notifications
You must be signed in to change notification settings - Fork 104
/
ykit.js
80 lines (75 loc) · 2.61 KB
/
ykit.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
function getEntry(name, demojs) {
if (!demojs) {
demojs = 'demo.js';
}
return ['babel-polyfill', './component_dev/' + name + '/demo/' + demojs];
}
exports.config = function (ykitPlugin) {
return {
exports: [
getEntry('actionsheet'),
getEntry('alert'),
getEntry('calendar'),
getEntry('carousel'),
getEntry('confirm'),
getEntry('datetimepicker'),
getEntry('dialog'),
getEntry('grouplist'),
getEntry('inputnumber'),
getEntry('list'),
getEntry('loading'),
getEntry('modal'),
getEntry('multilist'),
getEntry('picker'),
// getEntry('popup'),
getEntry('popupdatetimepicker'),
getEntry('popuppicker'),
getEntry('range'),
getEntry('rating'),
getEntry('scroller'),
getEntry('scroller', 'demo_simple.js'),
getEntry('scroller', 'demo_nest.js'),
getEntry('scroller', 'demo_structure_1.js'),
getEntry('scroller', 'demo_structure_2.js'),
getEntry('scroller', 'demo_structure_3.js'),
getEntry('scroller', 'demo_with_input.js'),
getEntry('scroller', 'refresh.js'),
getEntry('scroller', 'demo_sticky.js'),
getEntry('suggest'),
// getEntry('swipemenu'),
getEntry('swipemenulist'),
getEntry('switch'),
getEntry('toast')
],
modifyWebpackConfig: function (config) {
config.context = './';
var plugin = new this.webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('dev')
}
});
config.plugins.push(plugin);
config.output.prd.filename = '[name][ext]';
config.module = {
loaders: [
{
test: /\.scss$/,
loader: ykitPlugin.ExtractTextPlugin.extract(['css', 'sass'])
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react', 'stage-0']
}
}
]
};
config.devtool = 'source-map';
// ykit 的一个配置,用来实现 .scss -> .css
// config.entryExtNames.css.push('.scss')
return config;
}
}
};