diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..5ee7a3b --- /dev/null +++ b/.babelrc @@ -0,0 +1,41 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "edge": "17", + "firefox": "60", + "chrome": "67", + "safari": "11.1" + }, + "useBuiltIns": "usage", + "corejs": "3.6.5", + "debug": true + } + ], + "@babel/react" + ], + "plugins": [ + [ + "babel-plugin-styled-components", + { + "ssr": false + } + ], + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-json-strings", + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ], + "@babel/plugin-proposal-function-sent", + "@babel/plugin-proposal-export-namespace-from", + "@babel/plugin-proposal-numeric-separator", + "@babel/plugin-proposal-throw-expressions" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 64b641d..fab6ee8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,7 @@ { "cSpell.words": [ "cleanslate", + "corejs", "cssimportant" ], "[typescriptreact]": { diff --git a/package.json b/package.json index ab6735f..8d567f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typescript-react-embedded-widget-starter", - "version": "0.0.8", + "version": "0.0.9", "description": "building an embedded widget with react and typescript", "main": "dist/embedded-widget.js", "author": "Yuya Kakui https://github.com/kyaukyuai", @@ -21,33 +21,6 @@ "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" }, - "babel": { - "presets": [ - "airbnb" - ], - "plugins": [ - [ - "babel-plugin-styled-components", - { - "ssr": false - } - ], - "@babel/plugin-syntax-dynamic-import", - "@babel/plugin-syntax-import-meta", - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-json-strings", - [ - "@babel/plugin-proposal-decorators", - { - "legacy": true - } - ], - "@babel/plugin-proposal-function-sent", - "@babel/plugin-proposal-export-namespace-from", - "@babel/plugin-proposal-numeric-separator", - "@babel/plugin-proposal-throw-expressions" - ] - }, "dependencies": { "@styled-icons/ionicons-sharp": "^10.46.0", "@types/react": "^18.0.20", diff --git a/webpack.config.js b/webpack.config.js index 2b58a20..36f58cb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,7 +23,6 @@ module.exports = { use: [ { loader: 'babel-loader', - options: { presets: ['@babel/preset-env', '@babel/react'] }, }, { loader: 'ts-loader', @@ -42,5 +41,5 @@ module.exports = { resolve: { extensions: ['.ts', '.tsx', '.js', '.json'], }, - target: 'web', + target: ['web', 'es5'], }