Created
June 10, 2018 17:44
-
-
Save adamrunner/3b6554e0289521ae7591d8d536acd368 to your computer and use it in GitHub Desktop.
Example webpack config file for adding asset processing, allows import of CSS, Fonts, Data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Webpack Config File | |
// Allows import of: | |
// CSS styles | |
// Fonts | |
// CSV/TSV data | |
// XML data | |
const path = require('path'); | |
module.exports = { | |
entry: './src/index.js', | |
output: { | |
filename: 'bundle.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/, | |
use: [ | |
'style-loader', | |
'css-loader' | |
] | |
}, | |
{ | |
test: /\.(png|svg|jpg|gif)$/, | |
use: 'file-loader' | |
}, | |
{ | |
test: /\.(woff|woff2|eot|ttf|otf)$/, | |
use: 'file-loader' | |
}, | |
{ | |
test: /\.(csv|tsv)$/, | |
use: 'csv-loader' | |
}, | |
{ | |
test: /\.xml$/, | |
use: 'xml-loader' | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment