-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
45 lines (44 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
var SpritesmithPlugin = require('webpack-spritesmith');
var path = require('path');
module.exports = {
entry: ['./src/js/app.js'],
output: {
path: './assets',
filename: './js/app.js',
publicPath: '/',
},
devtool: 'source-map',
externals: {
jquery: 'jQuery'
},
module: {
loaders: [
{test: /\.(sass|scss)$/, loader: "style-loader!css-loader!sass-loader"},
{test: /\.js$/, loader: 'babel', exclude: /node_modules/},
{test: /\.png/, loader: 'file?name=img/[name].[ext]'},
{test: /\.ttf$|\.eot$|\.woff$|\.woff2$|\.svg$/, loader: 'file?name=font/[name].[ext]'}
],
babel: { presets: ['es2015'] }
},
resolve: {
modulesDirectories: ["node_modules", "spritesmith-generated"]
},
sassLoader: {
includePaths: [
path.resolve(__dirname, "node_modules/bootstrap-sass/assets/stylesheets/"),
path.resolve(__dirname, "Bootstrap/assets/src/")
]
},
plugins: [
//new ExtractTextPlugin("./css/styles.css"),
new SpritesmithPlugin({
src: { cwd: path.resolve(__dirname, 'src/sprites'), glob: '*.png' },
target: {
image: path.resolve(__dirname, 'src/img/sprite.png'),
css: path.resolve(__dirname, 'src/sass/settings/_sprite.scss')
},
apiOptions: { cssImageRef: "../img/sprite.png" },
retina: '@2x'
})
]
}