You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
991 B
50 lines
991 B
8 years ago
|
/**
|
||
|
* Base webpack config used across other specific configs
|
||
|
*/
|
||
|
|
||
7 years ago
|
import path from 'path'
|
||
7 years ago
|
import { IgnorePlugin } from 'webpack'
|
||
6 years ago
|
import { dependencies as externals } from '../../app/package.json'
|
||
|
|
||
|
export const rootDir = path.join(__dirname, '..', '..')
|
||
8 years ago
|
|
||
|
export default {
|
||
|
externals: Object.keys(externals || {}),
|
||
|
|
||
6 years ago
|
context: rootDir,
|
||
|
|
||
|
output: {
|
||
|
// https://github.com/webpack/webpack/issues/1114
|
||
|
libraryTarget: 'commonjs2'
|
||
|
},
|
||
|
|
||
8 years ago
|
module: {
|
||
7 years ago
|
rules: [
|
||
|
{
|
||
|
test: /\.jsx?$/,
|
||
|
exclude: /node_modules/,
|
||
|
use: {
|
||
|
loader: 'babel-loader',
|
||
|
options: {
|
||
|
cacheDirectory: true
|
||
|
}
|
||
8 years ago
|
}
|
||
|
}
|
||
7 years ago
|
]
|
||
8 years ago
|
},
|
||
|
|
||
|
/**
|
||
|
* Determine the array of extensions that should be used to resolve modules.
|
||
|
*/
|
||
|
resolve: {
|
||
|
extensions: ['.js', '.jsx', '.json'],
|
||
6 years ago
|
modules: [path.join(rootDir, 'app'), 'node_modules']
|
||
8 years ago
|
},
|
||
|
|
||
7 years ago
|
plugins: [new IgnorePlugin(/^\.\/locale$/, /moment$/)],
|
||
|
|
||
7 years ago
|
optimization: {
|
||
|
namedModules: true
|
||
|
}
|
||
8 years ago
|
}
|