-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.npm.base.conf.js
69 lines (67 loc) · 1.74 KB
/
webpack.npm.base.conf.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
/**
* @file webpack.npm.base.conf.js
*/
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var themeUrl = require('../package.json').theme;
var theme = require(path.join(__dirname, '../',themeUrl));
module.exports = {
entry: {
},
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: './',
filename: '[name].js',
// library: 'xcui',
libraryTarget: 'umd'
},
resolve: {
extensions: ['', '.js', '.vue'],
alias: {
'src': path.resolve(__dirname, '../src'),
'vue$': 'vue/dist/vue.js'
}
},
stats: {
children: false
},
resolveLoader: {
root: path.join(__dirname, 'node_modules')
},
module: {
loaders: [{
test: /\.vue$/,
loader: 'vue'
}, {
test: /\.js$/,
loader: 'babel!eslint',
exclude: /node_modules/
}, {
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader","css-loader!less-loader")
},{
test: /\.json$/,
loader: 'json'
}, {
test: /\.less\.components\.less$/,
loader: ExtractTextPlugin.extract(
'style-loader!'+
'css-loader!less-loader?{"modifyVars":'+ JSON.stringify(theme)+'}')
}, {
test: /\.(png|jpg|gif|svg|woff2?|eot|ttf)(\?.*)?$/,
loader: 'url',
query: {
limit: 10000,
name: '[name].[ext]?[hash:7]'
}
}]
},
vue: {
loaders: {
js: 'babel!eslint'
}
},
eslint: {
formatter: require('eslint-friendly-formatter')
}
};