-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
58 lines (55 loc) · 1.35 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
55
56
57
58
const webpack = require('webpack');
const path = require('path');
const precss = require('precss');
const autoprefixer = require('autoprefixer')({browsers: 'last 2 versions'});
var ExtractTextPlugin = require("extract-text-webpack-plugin");
const config = {
context: __dirname,
entry: {
main: [ './src/tmc-web-client.js' ],
},
output: {
path: path.join(__dirname, 'demo', 'assets'),
filename: 'tmc-web-client.js'
},
externals: {
"jquery": "jQuery",
"jszip": "JSZip",
"jszip-utils": "JSZipUtils",
"clipboard": "Clipboard",
"ace": "ace"
},
devtool: "#inline-source-map",
module: {
loaders: [
{
test: /\.(scss|sass)$/,
loader: ExtractTextPlugin.extract('style', ['css-loader', 'postcss-loader', 'sass-loader'])
},
{ test: /\.raw$/, loader: "raw" },
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-3'],
plugins: ['transform-runtime']
}
},
{
test: /\.template$/,
loader: "handlebars-loader"
}
]
},
postcss: () => {
return [autoprefixer, precss];
},
sassLoader: {
includePaths: [path.join(__dirname, 'src', 'css')]
},
plugins: [
new ExtractTextPlugin('tmc-web-client.css')
]
}
module.exports = config;