diff --git a/development.configuration.ts b/development.configuration.ts deleted file mode 100644 index eeeb40b..0000000 --- a/development.configuration.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Configuration } from 'elite-types'; - -const configuration: Configuration = { - featureMap: { - 'under-construction-message': true, - }, -}; - -export default configuration; diff --git a/package.json b/package.json index ad1b985..b3ac0dc 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,11 @@ "packages/*" ], "scripts": { - "clean": "lerna run clean --stream && rm -rfv node_modules tsconfig.tsbuildinfo", + "clean": "lerna run clean --stream && rm -rfv tsconfig.tsbuildinfo", "postinstall": "patch-package", "lint": "eslint './packages/*/src/**/*.{ts,d.ts}' --max-warnings 0", "lint:fix": "eslint './packages/*/src/**/*.{ts,d.ts}' --fix", - "build": "tsc -b && lerna run webpack:build --stream", + "build": "lerna run webpack:build --stream", "frontend:start": "lerna run frontend:start --stream", "frontend:watch": "lerna run frontend:watch --stream", "watch": "tsc -b -w" @@ -37,7 +37,6 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "react-hot-loader": "^4.12.18", - "source-map-loader": "^0.2.4", "style-loader": "^1.0.1", "ts-loader": "^6.2.1", "typescript": "^3.7.2", @@ -47,4 +46,4 @@ }, "resolutions": {}, "dependencies": {} -} \ No newline at end of file +} diff --git a/packages/configuration/package.json b/packages/configuration/package.json index dafe845..912f77c 100644 --- a/packages/configuration/package.json +++ b/packages/configuration/package.json @@ -5,8 +5,7 @@ "publishConfig": { "access": "public" }, - "types": "dist/index.d.ts", - "main": "dist/index.js", + "main": "src/index.ts", "scripts": { "clean": "rm -rf dist/ node_modules/ tsconfig.tsbuildinfo" }, diff --git a/packages/configuration/src/development.configuration.ts b/packages/configuration/src/development.configuration.ts deleted file mode 120000 index 5d97350..0000000 --- a/packages/configuration/src/development.configuration.ts +++ /dev/null @@ -1 +0,0 @@ -../../../development.configuration.ts \ No newline at end of file diff --git a/packages/configuration/src/development.configuration.ts b/packages/configuration/src/development.configuration.ts new file mode 100644 index 0000000..eeeb40b --- /dev/null +++ b/packages/configuration/src/development.configuration.ts @@ -0,0 +1,9 @@ +import { Configuration } from 'elite-types'; + +const configuration: Configuration = { + featureMap: { + 'under-construction-message': true, + }, +}; + +export default configuration; diff --git a/packages/configuration/src/production.configuration.ts b/packages/configuration/src/production.configuration.ts deleted file mode 120000 index d31b870..0000000 --- a/packages/configuration/src/production.configuration.ts +++ /dev/null @@ -1 +0,0 @@ -../../../production.configuration.ts \ No newline at end of file diff --git a/packages/configuration/src/production.configuration.ts b/packages/configuration/src/production.configuration.ts new file mode 100644 index 0000000..a21f371 --- /dev/null +++ b/packages/configuration/src/production.configuration.ts @@ -0,0 +1,9 @@ +import { Configuration } from 'elite-types'; + +const configuration: Configuration = { + featureMap: { + 'under-construction-message': false, + }, +}; + +export default configuration; diff --git a/packages/feature-flags/package.json b/packages/feature-flags/package.json index 209bd94..68f70a5 100644 --- a/packages/feature-flags/package.json +++ b/packages/feature-flags/package.json @@ -5,8 +5,7 @@ "publishConfig": { "access": "public" }, - "types": "dist/index.d.ts", - "main": "dist/index.js", + "main": "src/index.ts", "scripts": { "clean": "rm -rf dist/ node_modules/ tsconfig.tsbuildinfo" }, diff --git a/packages/frontend/webpack.config.js b/packages/frontend/development.webpack.config.js similarity index 96% rename from packages/frontend/webpack.config.js rename to packages/frontend/development.webpack.config.js index 14ea36e..c0bfeed 100644 --- a/packages/frontend/webpack.config.js +++ b/packages/frontend/development.webpack.config.js @@ -6,13 +6,15 @@ module.exports = { entry: { app: ['react-hot-loader/patch', './src/index.tsx'], }, - devtool: 'source-map', module: { rules: [ { test: /\.tsx?$/, use: { loader: require.resolve('ts-loader'), + options: { + projectReferences: true, + }, }, exclude: /node_modules/, }, diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 5468a6f..6fec32b 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -6,9 +6,9 @@ "access": "public" }, "scripts": { - "frontend:watch": "webpack-dev-server --mode development --color --hot --progress", - "frontend:start": "webpack-dev-server --mode production --color --progress", - "webpack:build": "webpack --mode production", + "frontend:watch": "webpack-dev-server --mode development --color --hot --progress --config development.webpack.config.js", + "frontend:start": "webpack-dev-server --mode production --color --hot --progress --config development.webpack.config.js", + "webpack:build": "webpack --mode production --config production.webpack.config.js", "clean": "rm -rf dist/ node_modules/ tsconfig.tsbuildinfo" }, "devDependencies": { diff --git a/packages/frontend/production.webpack.config.js b/packages/frontend/production.webpack.config.js new file mode 100644 index 0000000..7468be2 --- /dev/null +++ b/packages/frontend/production.webpack.config.js @@ -0,0 +1,72 @@ +const path = require('path'); +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +module.exports = { + entry: { + app: ['./src/index.tsx'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: { + loader: require.resolve('ts-loader'), + options: { + projectReferences: true, + }, + }, + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: ['style-loader', 'css-loader'], + }, + { + test: /\.html$/, + use: [ + { + loader: 'html-loader', + options: { minimize: true }, + }, + ], + }, + { + test: /\.(png|svg|jpg|gif|pdf)$/, + use: [ + { + loader: 'file-loader', + options: { + name: '[name].[ext]', + }, + }, + ], + }, + ], + }, + resolve: { + modules: ['node_modules'], + extensions: ['.ts', '.tsx', '.js', '.jsx'], + symlinks: true, + }, + output: { + publicPath: '/', + filename: 'frontend.bundle.js', + path: path.resolve(__dirname, 'dist'), + }, + plugins: [ + new HtmlWebpackPlugin({ + template: path.resolve(__dirname, 'src/index.html'), + inject: 'body', + }), + ], + node: { + module: 'empty', + dgram: 'empty', + dns: 'mock', + fs: 'empty', + http2: 'empty', + net: 'empty', + tls: 'empty', + child_process: 'empty', + }, +}; diff --git a/packages/types/package.json b/packages/types/package.json index 444a0b3..2f5cf4b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -5,13 +5,10 @@ "publishConfig": { "access": "public" }, - "types": "dist/index.d.ts", - "main": "dist/index.js", + "main": "src/index.ts", "scripts": { "clean": "rm -rf dist/ node_modules/ tsconfig.tsbuildinfo" }, - "devDependencies": { - }, - "dependencies": { - } + "devDependencies": {}, + "dependencies": {} } diff --git a/production.configuration.ts b/production.configuration.ts deleted file mode 100644 index a21f371..0000000 --- a/production.configuration.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Configuration } from 'elite-types'; - -const configuration: Configuration = { - featureMap: { - 'under-construction-message': false, - }, -}; - -export default configuration; diff --git a/tsconfig.base.json b/tsconfig.base.json index 6e7a660..c544db9 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -20,22 +20,15 @@ "moduleResolution": "node", "strict": true, "importHelpers": true, - "sourceMap": true, - "declarationMap": true, + "sourceMap": false, + "declarationMap": false, "declaration": true, "composite": true, "allowSyntheticDefaultImports": true, "jsx": "react", - "lib": [ - "esnext", - "dom" - ], + "lib": ["esnext", "dom"], "resolveJsonModule": true, "esModuleInterop": true }, - "exclude": [ - "./node_modules", - "./packages/*/node_modules", - "./packages/*/dist" - ] -} \ No newline at end of file + "exclude": ["./node_modules", "./packages/*/node_modules", "./packages/*/dist"] +} diff --git a/yarn.lock b/yarn.lock index 5ce0359..40fd992 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1564,7 +1564,7 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async@^2.5.0, async@^2.6.2: +async@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== @@ -7568,14 +7568,6 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== -source-map-loader@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/source-map-loader/-/source-map-loader-0.2.4.tgz#c18b0dc6e23bf66f6792437557c569a11e072271" - integrity sha512-OU6UJUty+i2JDpTItnizPrlpOIBLmQbWMuBg9q5bVtnHACqw1tn9nNwqJLbv0/00JjnJb/Ee5g5WS5vrRv7zIQ== - dependencies: - async "^2.5.0" - loader-utils "^1.1.0" - source-map-resolve@^0.5.0: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"