|
@ -1,38 +1,32 @@ |
|
|
const path = require('path'); |
|
|
|
|
|
|
|
|
var HtmlWebpackPlugin = require('html-webpack-plugin'); |
|
|
|
|
|
var ExtractTextPlugin = require('extract-text-webpack-plugin'); |
|
|
|
|
|
var path = require("path"); |
|
|
|
|
|
|
|
|
module.exports = [{ |
|
|
|
|
|
name: 'js', |
|
|
|
|
|
|
|
|
module.exports = { |
|
|
entry: ['./src/index.js'], |
|
|
entry: ['./src/index.js'], |
|
|
output: { |
|
|
output: { |
|
|
filename: 'main.js', |
|
|
|
|
|
path: path.resolve(__dirname, 'dist') |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'css', |
|
|
|
|
|
entry: ['./src/style.sass'], |
|
|
|
|
|
module: { |
|
|
|
|
|
rules: [ |
|
|
|
|
|
{ |
|
|
|
|
|
test: /\.sass$/, |
|
|
|
|
|
use: [ |
|
|
|
|
|
{ |
|
|
|
|
|
loader: 'file-loader', |
|
|
|
|
|
options: { |
|
|
|
|
|
name: 'style.css', |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
loader: 'extract-loader' |
|
|
|
|
|
|
|
|
path: path.join(__dirname, "./dist/"), |
|
|
|
|
|
filename: "main.js", |
|
|
}, |
|
|
}, |
|
|
|
|
|
module:{ |
|
|
|
|
|
rules:[ |
|
|
{ |
|
|
{ |
|
|
loader: 'css-loader?-url' |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
loader: 'sass-loader' |
|
|
|
|
|
|
|
|
test:/\.sass$/, |
|
|
|
|
|
use: ExtractTextPlugin.extract({ |
|
|
|
|
|
fallback:'style-loader', |
|
|
|
|
|
use:['css-loader','sass-loader'] |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
plugins: [ |
|
|
|
|
|
new ExtractTextPlugin({filename:'style.css'}), |
|
|
|
|
|
new HtmlWebpackPlugin({ |
|
|
|
|
|
hash: true, |
|
|
|
|
|
title: 'Weather for Philadelphia, PA', |
|
|
|
|
|
template: './src/index.html', |
|
|
|
|
|
path: path.join(__dirname, "./dist/"), |
|
|
|
|
|
filename: 'index.html' |
|
|
|
|
|
}), |
|
|
] |
|
|
] |
|
|
} |
|
|
|
|
|
}]; |
|
|
|
|
|
|
|
|
} |