diff --git a/cypress.config.js b/cypress.config.js index 4b74a245..e6748136 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -6,7 +6,15 @@ module.exports = defineConfig({ baseUrl: 'http://localhost:6006', video: false, setupNodeEvents(on) { - on('file:preprocessor', webpackPreprocessor()) + on( + 'file:preprocessor', + webpackPreprocessor({ + webpackOptions: { + ...webpackPreprocessor.defaultOptions.webpackOptions, + target: 'web', + }, + }), + ) }, }, }) diff --git a/docusaurus.config.js b/docusaurus.config.js index 0adb3f90..c0ab1ed5 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -36,7 +36,16 @@ const config = { }), ], ], - plugins: [require.resolve('./docusaurus/plugins/webpack5polyfills.js')], + plugins: [ + // @ts-ignore + () => ({ + name: 'configure-webpack-target', + configureWebpack(webpackConfig, isServer) { + webpackConfig.target = isServer ? 'node' : 'web' + }, + }), + require.resolve('./docusaurus/plugins/webpack5polyfills.js'), + ], } module.exports = config diff --git a/package.json b/package.json index 7bcec14a..755bcdd7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "module": "dist/downshift.esm.js", "typings": "typings/index.d.ts", "sideEffects": false, + "browserslist": [], "scripts": { "build": "npm run build:web --silent && npm run build:native --silent", "build:web": "kcd-scripts build --bundle --p-react --no-clean --size-snapshot",