-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
54 lines (52 loc) · 1.37 KB
/
webpack.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
// By default eslint assumes packages imported are supposed to be dependencies,
// not devDependencies. Disabling this rule in webpack.conig.js
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const path = require('path');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
'terra-module': path.join(__dirname, 'demos', 'demo'),
},
module: {
loaders: [
{
test: /\.(jsx|js)$/,
exclude: /node_modules/,
loader: 'babel',
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'css!postcss!sass'),
},
],
},
output: {
filename: '[name].js',
path: path.join(__dirname, 'dist'),
},
plugins: [
new ExtractTextPlugin('[name].css'),
new HtmlWebpackPlugin({
template: 'demos/demo.html',
}),
],
postcss: [
autoprefixer({
browsers: [
'ie >= 10',
'last 2 versions',
'last 2 android versions',
'last 2 and_chr versions',
'iOS >= 8',
],
}),
],
resolve: {
extensions: ['', '.webpack.js', '.js', '.jsx'],
},
sassLoader: {
data: `@import "${path.resolve('node_modules/terra-legacy-theme/src/terra-legacy-theme.scss')}";`,
},
};