From 9d80884d2c5ada96be47295093644f1e86bc75f4 Mon Sep 17 00:00:00 2001 From: one-more Date: Wed, 4 Sep 2019 16:33:35 +0300 Subject: [PATCH] use babel-preset-typescript instead of awesome-typescript-loader --- .babelrc | 10 ++++++++++ package.json | 6 +++++- packages/core/.babelrc | 3 +++ packages/framework/.babelrc | 3 +++ packages/framework/dependencies.d.ts | 8 -------- packages/framework/package.json | 7 +++---- webpack.config.js | 13 +------------ 7 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 .babelrc create mode 100644 packages/core/.babelrc create mode 100644 packages/framework/.babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..ed6cac1 --- /dev/null +++ b/.babelrc @@ -0,0 +1,10 @@ +{ + "presets": [ + "@babel/env", + "@babel/preset-typescript" + ], + "plugins": [ + "@babel/proposal-class-properties", + "@babel/proposal-object-rest-spread" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index dce394c..5731c86 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,13 @@ "private": false, "devDependencies": { "@babel/core": "^7.5.5", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-object-rest-spread": "^7.5.5", "@babel/preset-env": "^7.5.5", + "@babel/preset-typescript": "^7.3.3", "@types/react": "^16.9.2", - "awesome-typescript-loader": "^5.2.1", + "@types/react-dom": "^16.9.0", + "babel-loader": "^8.0.6", "clean-webpack-plugin": "^3.0.0", "lerna": "^3.15.0", "typescript": "^3.6.2", diff --git a/packages/core/.babelrc b/packages/core/.babelrc new file mode 100644 index 0000000..ab0ff3a --- /dev/null +++ b/packages/core/.babelrc @@ -0,0 +1,3 @@ +{ + "extends": "../../.babelrc" +} \ No newline at end of file diff --git a/packages/framework/.babelrc b/packages/framework/.babelrc new file mode 100644 index 0000000..ab0ff3a --- /dev/null +++ b/packages/framework/.babelrc @@ -0,0 +1,3 @@ +{ + "extends": "../../.babelrc" +} \ No newline at end of file diff --git a/packages/framework/dependencies.d.ts b/packages/framework/dependencies.d.ts index c8eba83..46b4ff2 100644 --- a/packages/framework/dependencies.d.ts +++ b/packages/framework/dependencies.d.ts @@ -12,14 +12,6 @@ declare module '@micro-frontends/core' { function store(key: StorageKey, value: T): void; } -declare module react { - interface ReactElement {} -} - -declare module 'react-dom' { - function render(element: react.ReactElement, container: Element): void; -} - declare module 'vue' { interface VueConstructor {} export default class Vue { diff --git a/packages/framework/package.json b/packages/framework/package.json index 17240b5..af4afac 100644 --- a/packages/framework/package.json +++ b/packages/framework/package.json @@ -7,7 +7,9 @@ "build": "webpack --config webpack.config.js && tsc --declaration --outDir dist/ --emitDeclarationOnly", "prepublish": "build" }, - "keywords": ["micro-frontends"], + "keywords": [ + "micro-frontends" + ], "author": "one-more", "contributors": [ "master-7" @@ -19,8 +21,5 @@ "react-dom": "^16.8.6", "vue": "^2.6.10" }, - "dependencies": { - "styled-components": "^4.3.1" - }, "gitHead": "1649eb321d10c42b3136961c9a34edf4b57c894a" } diff --git a/webpack.config.js b/webpack.config.js index 97fcb75..e4db3a6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,22 +2,11 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin'); module.exports = { mode: 'production', - module: { rules: [ { test: /\.ts$/, - loader: "awesome-typescript-loader", - options: { - "useBabel": true, - "babelOptions": { - "babelrc": true, - "presets": [ - ["@babel/preset-env", { "targets": "last 2 versions, ie 11", "modules": false }] - ] - }, - "babelCore": "@babel/core", - } + loader: "babel-loader", }, ] },