Last active
October 29, 2018 16:52
-
-
Save ryoldash/da02a860445a6bfabbe11b6b02d1c72b to your computer and use it in GitHub Desktop.
Customize webpack configuration of React App created with Create-react-app
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
const path = require('path'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin') | |
module.exports = { | |
entry: { | |
main: './src/index.js' | |
}, | |
output: { | |
filename: 'main.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' | |
] | |
} | |
] | |
}, | |
plugins: [ new CopyWebpackPlugin([{from: './src/lib/legacyLib.js'}])] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment