Nathan Bergey
6 years ago
5 changed files with 46 additions and 43 deletions
@ -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') |
|||
} |
|||
}, |
|||
{ |
|||
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' |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
}]; |
|||
path: path.join(__dirname, "./dist/"), |
|||
filename: "main.js", |
|||
}, |
|||
module:{ |
|||
rules:[ |
|||
{ |
|||
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' |
|||
}), |
|||
] |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue