Created
November 24, 2018 01:43
-
-
Save Nantris/d037cc6643932499f32d8f3b192cbb8c to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Base webpack config used across other specific configs | |
*/ | |
import path from 'path'; | |
import webpack from 'webpack'; | |
import merge from 'webpack-merge'; | |
import externals from './externals'; | |
const rootPath = process.cwd(); | |
const appFolderPath = path.join(rootPath, 'app'); | |
export default { | |
externals: [...externals], | |
context: rootPath, | |
module: { | |
rules: [ | |
{ | |
test: /\.jsx?$/, | |
exclude: /node_modules/, | |
use: { | |
loader: 'babel-loader', | |
options: { | |
cacheDirectory: true, | |
}, | |
}, | |
}, | |
// Images | |
{ | |
test: /\.(?:ico|gif|png|jpg|jpeg|webp)$/, | |
use: 'url-loader', | |
}, | |
], | |
}, | |
output: { | |
path: appFolderPath, | |
// https://github.com/webpack/webpack/issues/1114 | |
libraryTarget: 'commonjs2', | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment