-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
65 lines (59 loc) · 1.55 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
59
60
61
62
63
64
65
/*
* Module Dependencies
* */
var webpack = require('webpack')
var path = require('path')
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var extractCSS = new ExtractTextPlugin('css/squares-grid.min.css')
// Plugins POSTCSS
var lost = require('lost') //GridSystem with PostCSS
var autoprefixer = require('autoprefixer') //autoprefixer
var rucksackCSS = require('rucksack-css') //font-size responsive
var mediasMinMax = require('postcss-media-minmax') //Abreviación de sintaxis en los Media queries con >= o <=
var customMedias = require('postcss-custom-media') //Crea media queries custom como: @custom-media --mobile (min-width: 500px)
// Routes
var BUILD_DIR = path.join(__dirname, 'dist') //Outpout
var APP_DIR = path.join(__dirname, 'src') //Input
var config = {
resolve: {
extensions: ['', '.js', '.sass', '.scss', '.html']
},
entry: APP_DIR,
output: {
path: BUILD_DIR,
filename: 'js/[name].bundle.js',
publicPath: '/'
},
devServer: {
host: '0.0.0.0',
port: 3000,
inline: true
},
module: {
loaders: [{
test: /\.js$/,
include: APP_DIR,
exclude: /(node_modules|bower_components)/,
loader: "babel-loader"
},{
test: /\.(sass|scss)$/,
loader: extractCSS.extract(['css?minimize','postcss','sass'])
}]
},
postcss: function () {
return {
plugins: [
autoprefixer,
lost,
rucksackCSS,
mediasMinMax,
customMedias
]
}
},
sassLoader: {
indentedSyntax: true
},
plugins: [extractCSS]
}
module.exports = config;