Skip to content

Instantly share code, notes, and snippets.

@Nantris
Created November 24, 2018 01:43
Show Gist options
  • Save Nantris/d037cc6643932499f32d8f3b192cbb8c to your computer and use it in GitHub Desktop.
Save Nantris/d037cc6643932499f32d8f3b192cbb8c to your computer and use it in GitHub Desktop.
/**
* 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