explicitly resolve packages in config

This commit is contained in:
Alfred Melch 2020-02-02 10:02:31 +01:00
parent 2de1c47ed6
commit ecc9e90bec
3 changed files with 14 additions and 5 deletions

View File

@ -2,7 +2,10 @@ module.exports = api => {
// caching the babel config // caching the babel config
api.cache.using(() => process.env.NODE_ENV) api.cache.using(() => process.env.NODE_ENV)
return { return {
presets: ['@babel/preset-env', '@babel/preset-react'] presets: [
require.resolve('@babel/preset-env'),
require.resolve('@babel/preset-react')
]
// plugins: [api.env('development') && 'react-refresh/babel'].filter(Boolean) // plugins: [api.env('development') && 'react-refresh/babel'].filter(Boolean)
} }
} }

6
data/jsconfig.json Normal file
View File

@ -0,0 +1,6 @@
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src", "lib"]
}

View File

@ -25,16 +25,16 @@ module.exports = (env, argv) => {
{ {
test: /\.js$/, test: /\.js$/,
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader' loader: require.resolve('babel-loader')
}, },
// process css. css modules are enabled. // process css. css modules are enabled.
{ {
test: /\.css$/, test: /\.css$/,
use: [ use: [
isEnvDevelopment && 'style-loader', isEnvDevelopment && require.resolve('style-loader'),
isEnvProduction && MiniCssExtractPlugin.loader, isEnvProduction && MiniCssExtractPlugin.loader,
{ {
loader: 'css-loader', loader: require.resolve('css-loader'),
options: { options: {
modules: { modules: {
localIdentName: isEnvProduction localIdentName: isEnvProduction
@ -43,7 +43,7 @@ module.exports = (env, argv) => {
} }
} }
}, },
'postcss-loader' require.resolve('postcss-loader')
].filter(Boolean) ].filter(Boolean)
} }
] ]