From ecc9e90bec474080103a956809744b0e62d922ce Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Sun, 2 Feb 2020 10:02:31 +0100 Subject: [PATCH] explicitly resolve packages in config --- babel.config.js | 5 ++++- data/jsconfig.json | 6 ++++++ webpack.config.js | 8 ++++---- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 data/jsconfig.json diff --git a/babel.config.js b/babel.config.js index 133caad..90772a9 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,7 +2,10 @@ module.exports = api => { // caching the babel config api.cache.using(() => process.env.NODE_ENV) 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) } } diff --git a/data/jsconfig.json b/data/jsconfig.json new file mode 100644 index 0000000..cdfbd18 --- /dev/null +++ b/data/jsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "baseUrl": "src" + }, + "include": ["src", "lib"] +} diff --git a/webpack.config.js b/webpack.config.js index 36e873a..1786305 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,16 +25,16 @@ module.exports = (env, argv) => { { test: /\.js$/, exclude: /node_modules/, - loader: 'babel-loader' + loader: require.resolve('babel-loader') }, // process css. css modules are enabled. { test: /\.css$/, use: [ - isEnvDevelopment && 'style-loader', + isEnvDevelopment && require.resolve('style-loader'), isEnvProduction && MiniCssExtractPlugin.loader, { - loader: 'css-loader', + loader: require.resolve('css-loader'), options: { modules: { localIdentName: isEnvProduction @@ -43,7 +43,7 @@ module.exports = (env, argv) => { } } }, - 'postcss-loader' + require.resolve('postcss-loader') ].filter(Boolean) } ]