-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
65 lines (64 loc) · 2.05 KB
/
Copy pathwebpack.config.js
File metadata and controls
65 lines (64 loc) · 2.05 KB
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
//webpack.config.js
var webpack = require('webpack');
const path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports={
entry:[
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'bootstrap-loader',
'./src/index.jsx'
],
module:{
preLoaders: [ //добавили ESlint в preloaders
{test: /\.jsx?$/, loader: "eslint-loader", exclude: /node_modules/}
],
loaders:[
{test:/\.jsx?$/,exclude:/node_modules/,loader:'react-hot!babel'},
{test: /\.js$/,loader: 'imports?jQuery=jquery',exclude: /\/node_modules\//},
{
test: /\.css$/,
loader: 'style!css'
},
{test: /\.scss$/,loaders: [ 'style', 'css', 'postcss', 'sass' ]},
{test: /\.(ttf|eot|svg|woff|woff2|png|jpg)$/,loader: 'file?name=[path][name].[ext]'},
{test: /\.scss$/,loader: ExtractTextPlugin.extract(
'style',
'css?modules&importLoaders=2&localIdentName=[name]__[local]__[hash:base64:5]' +
'!sass' +
'!sass-resources'
),
},
{ test: /bootstrap-sass\/assets\/javascripts\//, loader: 'imports?jQuery=jquery' }
]
},
sassResources: './config/sass-resources.scss',
eslint: {configFile: './.eslintrc'},
resolve:{
extensions:['','.js','.jsx']
},
output:{
path:path.resolve('./dist'),
filename: '[name].js',
publicPath:'/',
library: '[name]'
},
devServer:{
contentBase:'./dist',
hot:true,
historyApiFallback:{
index:'index.html'
},
port: 8080
},
plugins:[
new webpack.HotModuleReplacementPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
_: "underscore"
}),
new ExtractTextPlugin("styles.css"),
new webpack.ProvidePlugin({"window.Tether": "tether"}),
]
}