|
|
@ -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'], |
|
|
|
output: { |
|
|
|
filename: 'main.js', |
|
|
|
path: path.resolve(__dirname, 'dist') |
|
|
|
} |
|
|
|
path: path.join(__dirname, "./dist/"), |
|
|
|
filename: "main.js", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: 'css', |
|
|
|
entry: ['./src/style.sass'], |
|
|
|
module:{ |
|
|
|
rules:[ |
|
|
|
{ |
|
|
|
test:/\.sass$/, |
|
|
|
use: [ |
|
|
|
{ |
|
|
|
loader: 'file-loader', |
|
|
|
options: { |
|
|
|
name: 'style.css', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
loader: 'extract-loader' |
|
|
|
}, |
|
|
|
{ |
|
|
|
loader: 'css-loader?-url' |
|
|
|
}, |
|
|
|
{ |
|
|
|
loader: 'sass-loader' |
|
|
|
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' |
|
|
|
}), |
|
|
|
] |
|
|
|
} |
|
|
|
}]; |