Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial config for UI slot #518

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions config/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const path = require('path');
const { babel } = require('../lib/presets');

module.exports = {
Expand All @@ -9,6 +10,21 @@ module.exports = {
configFile: babel.resolvedFilepath || babel.defaultFilepath,
},
},
settings: {
'import/resolver': {
webpack: {
config: path.resolve(__dirname, 'webpack.dev.config.js'),
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
alias: {
map: [
['@root_path', path.resolve(process.cwd(), '.')],
],
},
},
},
rules: {
'import/no-extraneous-dependencies': [
'error',
Expand All @@ -35,6 +51,7 @@ module.exports = {
}],
'import/no-import-module-export': 'off',
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
'import/prefer-default-export': 'off',
},
globals: {
newrelic: false,
Expand Down
2 changes: 2 additions & 0 deletions config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ module.exports = {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.resolve(__dirname, 'jest/fileMock.js'),
'\\.(css|scss)$': 'identity-obj-proxy',
'env.config': envConfigPath,
'@node_modules/(.*)': '<rootDir>/node_modules/$1',
'@root_path/(.*)': '<rootDir>/$1',
},
collectCoverageFrom: [
'src/**/*.{js,jsx}',
Expand Down
4 changes: 3 additions & 1 deletion config/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ module.exports = {
resolve: {
alias: {
'env.config': path.resolve(process.cwd(), './env.config'),
'@node_modules': path.join(process.cwd(), 'node_modules'),
'@root_path': path.join(process.cwd(), '.'),
},
fallback: {
// This causes the system to return an empty object if it can't find an env.config.js file in
// the application being built.
'env.config': false,
},
extensions: ['.js', '.jsx'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
ignoreWarnings: [
// Ignore warnings raised by source-map-loader.
Expand Down
7 changes: 6 additions & 1 deletion config/webpack.dev-stage.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ module.exports = merge(commonConfig, {
publicPath: PUBLIC_PATH,
},
resolve: {
alias: aliases,
alias: {
...aliases,
'@node_modules': path.join(process.cwd(), 'node_modules'),
'@root_path': path.join(process.cwd(), '.'),
},
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
// Specify file-by-file rules to Webpack. Some file-types need a particular kind of loader.
Expand Down
6 changes: 5 additions & 1 deletion config/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ module.exports = merge(commonConfig, {
publicPath: PUBLIC_PATH,
},
resolve: {
alias: aliases,
alias: {
...aliases,
'@node_modules': path.join(process.cwd(), 'node_modules'),
'@root_path': path.join(process.cwd(), '.'),
},
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
Expand Down
7 changes: 7 additions & 0 deletions config/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ module.exports = merge(commonConfig, {
path: path.resolve(process.cwd(), 'dist'),
publicPath: process.env.PUBLIC_PATH || '/',
},
resolve: {
alias: {
'@node_modules': path.join(process.cwd(), 'node_modules'),
'@root_path': path.join(process.cwd(), '.'),
},
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
// Specify file-by-file rules to Webpack. Some file-types need a particular kind of loader.
rules: [
Expand Down
Loading
Loading