diff --git a/awx/ui/.npmrc b/awx/ui/.npmrc index c42da845..f7410ede 100644 --- a/awx/ui/.npmrc +++ b/awx/ui/.npmrc @@ -1 +1,7 @@ engine-strict = true +@ctrliq:registry=https://npm.pkg.github.com +# - generate a new GitHub token (classic) with the read:packages scope (https://github.com/settings/tokens/new) +# - copy the token and set it as an environment variable in your shell +# export NPM_TOKEN=ghp_your_token_here +# (you can also add it to your ~/.bashrc, ~/.zshrc, etc. if you want it to be persistent) +//npm.pkg.github.com/:_authToken=${NPM_TOKEN} \ No newline at end of file diff --git a/awx/ui/config/webpack.config.js b/awx/ui/config/webpack.config.js index 2ec0c72e..b6a1afdf 100644 --- a/awx/ui/config/webpack.config.js +++ b/awx/ui/config/webpack.config.js @@ -222,12 +222,13 @@ module.exports = function (webpackEnv) { publicPath: paths.publicUrlOrPath, // Point sourcemap entries to original disk location (format as URL on Windows) devtoolModuleFilenameTemplate: isEnvProduction - ? info => + ? (info) => path .relative(paths.appSrc, info.absoluteResourcePath) .replace(/\\/g, '/') : isEnvDevelopment && - (info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')), + ((info) => + path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')), }, cache: { type: 'filesystem', @@ -237,7 +238,7 @@ module.exports = function (webpackEnv) { buildDependencies: { defaultWebpack: ['webpack/lib/'], config: [__filename], - tsconfig: [paths.appTsConfig, paths.appJsConfig].filter(f => + tsconfig: [paths.appTsConfig, paths.appJsConfig].filter((f) => fs.existsSync(f) ), }, @@ -307,8 +308,8 @@ module.exports = function (webpackEnv) { // `web` extension prefixes have been added for better support // for React Native Web. extensions: paths.moduleFileExtensions - .map(ext => `.${ext}`) - .filter(ext => useTypeScript || !ext.includes('ts')), + .map((ext) => `.${ext}`) + .filter((ext) => useTypeScript || !ext.includes('ts')), alias: { // Support React Native Web // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/ @@ -419,7 +420,7 @@ module.exports = function (webpackEnv) { }, ], ], - + plugins: [ isEnvDevelopment && shouldUseReactRefresh && @@ -453,7 +454,7 @@ module.exports = function (webpackEnv) { cacheDirectory: true, // See #6846 for context on why cacheCompression is disabled cacheCompression: false, - + // Babel sourcemaps are needed for debugging into node_modules // code. Without the options below, debuggers like VSCode // show incorrect code and set breakpoints on the wrong lines. @@ -543,6 +544,10 @@ module.exports = function (webpackEnv) { 'sass-loader' ), }, + { + test: /\.(woff|woff2|eot|ttf|otf)$/i, + type: 'asset/resource', + }, // "file" loader makes sure those assets get served by WebpackDevServer. // When you `import` an asset, you get its (virtual) filename. // In production, they would get copied to the `build` folder. @@ -566,7 +571,7 @@ module.exports = function (webpackEnv) { { message: /source-map-loader/, module: /node_modules\/rrule/, - } + }, ], plugins: [ // Generates an `index.html` file with the