-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidgets.config.js
61 lines (56 loc) · 1.8 KB
/
widgets.config.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
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var AutoPrefixer = require('autoprefixer');
var options = require('./project');
var pkg = require('./package.json');
var env = process.env.NODE_ENV
, jshash = '.[hash:10]'
, plugins = []
, loaders = [
{ test: /\.js$/, loader: "babel" }
];
if ( env != 'production' ){
jshash = '';
plugins = [];
loaders.push(
{ test: /\.css$/, loader: "style!css!postcss" },
{ test: /\.less$/, loader: "style!css!postcss!less" },
{ test: /\.scss$/, loader: "style!css!postcss!sass" },
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' },
{ test: /\.html$/, loader: "html" }
);
}
else{
loaders.push(
{ test: /\.css$/, loader: ExtractTextPlugin.extract("style", "css!postcss") },
{ test: /\.less$/, loader: ExtractTextPlugin.extract("style", "css!postcss!less") },
{ test: /\.scss$/, loader: ExtractTextPlugin.extract("style", "css!postcss!sass") },
{ test: /\.html$/, loader: "html!html-minify" }
);
plugins.push(new ExtractTextPlugin('./index.css'));
}
var result = {
entry: './node_modules/miox-components/index.js',
output: {
path: './node_modules/miox-components/build/',
filename: 'index.js',
library: 'MioxComponents',
libraryTarget: 'umd'
},
module: {
loaders: loaders,
postLoaders: [
{ test: /vue-icons/, loader: "callback-loader"}
]
},
callbackLoader:require("vue-icons/icon-loader")([
"fa-thumbs-up",
"fa-angle-right",
"iconic-chevron-right",
"octicon-chevron-right"
]),
postcss: function(){
return [AutoPrefixer({ browsers: ['last 20 versions'] })]
},
plugins: plugins
};
module.exports = result;