diff --git a/.gitignore b/.gitignore index 4d29575..23a10cb 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +aggregated-translations/* +.eslintcache diff --git a/config-overrides.js b/config-overrides.js new file mode 100644 index 0000000..3366f92 --- /dev/null +++ b/config-overrides.js @@ -0,0 +1,23 @@ +module.exports = { + webpack(config, env) { + // config.entry = './src/single-spa-entry.js'; + config.externals = ['react', 'react-dom', 'single-spa', new RegExp(`^@nickpith/`)]; + config.output = { + ...config.output, + filename: 'nickpith-root-config.js', + libraryTarget: 'system', + }; + config.plugins = config.plugins.filter(plugin => plugin.constructor.name !== 'HtmlWebpackPlugin' && plugin.constructor.name !== 'MiniCssExtractPlugin'); + delete config.optimization; + return config; + }, + devServer(configFunction) { + return function (proxy, allowedHost) { + const config = configFunction(proxy, allowedHost); + config.disableHostCheck = true + config.headers = config.headers || {} + config.headers['Access-Control-Allow-Origin'] = '*' + return config + } + } +} diff --git a/package.json b/package.json index d3b6bee..174ec19 100644 --- a/package.json +++ b/package.json @@ -3,18 +3,29 @@ "version": "0.1.0", "private": true, "dependencies": { + "react": "^16.8.5", + "react-dom": "^16.8.5", + "react-intl": "^2.8.0", + "react-router-dom": "^5.2.0", + "single-spa": "^5.9.1", + "systemjs-webpack-interop": "^2.3.4", + "terra-application": "^1.41.1", + "web-vitals": "^0.2.4" + }, + "devDependencies": { "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", - "react": "^17.0.1", - "react-dom": "^17.0.1", + "node-sass": "^4.12.0", + "react-app-rewired": "^2.1.8", "react-scripts": "4.0.1", - "web-vitals": "^0.2.4" + "terra-aggregate-translations": "^1.0.0" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", + "aggregate-translations": "tt-aggregate-translations -l ['en'] -d ./translations -o ./node_modules/terra-i18n/node_modules -f es6", + "start": "yarn run aggregate-translations && react-app-rewired start", + "build": "yarn run aggregate-translations && react-app-rewired build", + "test": "yarn run aggregate-translations && react-app-rewired test", "eject": "react-scripts eject" }, "eslintConfig": { diff --git a/public/index.html b/public/index.html index aa069f2..a9cfdf7 100644 --- a/public/index.html +++ b/public/index.html @@ -1,20 +1,44 @@ - +
- + - + + + + + + + + + + - +