-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathwebpack.config.dev.js
executable file
·87 lines (84 loc) · 1.95 KB
/
webpack.config.dev.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
81
82
83
84
85
86
87
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var config = {
devtool: 'eval',
entry: {
app: [
'eventsource-polyfill',
'webpack-hot-middleware/client',
'./example/index.jsx'
],
},
resolve: {
extensions: ["", ".jsx", ".js", ".scss"],
alias: {
'react-fabricjs': path.join(__dirname, 'src'),
'react-fabricjs/lib': path.join(__dirname, 'src'),
},
},
output: {
path: path.join(__dirname, 'example/public/'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
],
module: {
loaders: [
{
test: /\.(js|jsx)$/,
loaders: ['babel'],
include: [path.join(__dirname, 'src'), path.join(__dirname, 'example')],
exclude: path.join(__dirname, 'node_modules'),
},
{
test: /\.css$/,
loaders: [
'style-loader',
'css-loader',
'postcss-loader',
],
include: path.join(__dirname, 'example'),
},
{
test: /\.scss$/,
loaders: [
'style-loader',
'css-loader',
'postcss-loader',
'sass-loader',
],
include: path.join(__dirname, 'example'),
},
// {
// test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
// loader: "url-loader?limit=10000&mimetype=application/font-woff&name=[name].[ext]"
// },
// {
// test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
// loader: "file-loader?name=[name].[ext]"
// },
// {
// test: /\.(jpe?g|png|gif|svg)$/i,
// loaders: [
// 'file?hash=sha512&digest=hex&name=[hash].[ext]',
// 'image-webpack?bypassOnDebug&optimizationLevel=7&interlaced=false'
// ]
// }
],
noParse: [],
},
postcss: function () {
return [autoprefixer];
},
};
//
// deps.forEach(function (dep) {
// var depPath = path.resolve(nodeModules, dep);
// config.resolve.alias[dep.split(path.sep)[0]] = depPath;
// config.module.noParse.push(depPath);
// });
module.exports = config;