From 36202e6b83efd368d20d5c74c33c1628a4165e19 Mon Sep 17 00:00:00 2001 From: Jake Lee Kennedy Date: Mon, 13 Jan 2025 14:02:58 +0000 Subject: [PATCH] naming and use output path from config --- .github/workflows/ci.yml | 4 ++-- webpack.config.prod.mjs | 2 +- webpack/prout-plugin.mjs | 20 ++------------------ webpack/update-parameter-store-plugin.mjs | 8 ++------ 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe042c7c4..ab545ee7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,6 +150,6 @@ jobs: configPath: ./riff-raff.yaml contentDirectories: | frontend-static/commercial: - - dist/riff-raff/js/commercial + - dist/prod/artifacts/commercial commercial-bundle-path: - - dist/riff-raff/cloudformation + - dist/prod/cloudformation diff --git a/webpack.config.prod.mjs b/webpack.config.prod.mjs index b0da26db4..bdb5d823b 100644 --- a/webpack.config.prod.mjs +++ b/webpack.config.prod.mjs @@ -27,7 +27,7 @@ export default merge(config, { output: { filename: `commercial/${prefix}graun.standalone.commercial.js`, chunkFilename: `commercial/${prefix}graun.[name].commercial.js`, - path: join(import.meta.dirname, 'dist', 'riff-raff', 'js'), + path: join(import.meta.dirname, 'dist', 'prod', 'artifacts'), publicPath: 'auto', clean: true, }, diff --git a/webpack/prout-plugin.mjs b/webpack/prout-plugin.mjs index 2525edd2c..2f1a03d5c 100644 --- a/webpack/prout-plugin.mjs +++ b/webpack/prout-plugin.mjs @@ -9,27 +9,11 @@ export class PROutPlugin { * @param {import('webpack').Compiler} compiler */ apply = (compiler) => { - compiler.hooks.afterEmit.tap('AfterEmitPlugin', () => { + compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { const commitSHA = execSync('git rev-parse HEAD').toString().trim(); - compiler.outputFileSystem.mkdirSync( - join( - import.meta.dirname, - '..', - 'dist', - 'riff-raff', - 'js', - 'commercial', - ), - { recursive: true }, - ); - const outputPath = join( - import.meta.dirname, - '..', - 'dist', - 'riff-raff', - 'js', + compilation.outputOptions.path, 'commercial', `prout`, ); diff --git a/webpack/update-parameter-store-plugin.mjs b/webpack/update-parameter-store-plugin.mjs index 3cd31cbf1..cecbdd0ef 100644 --- a/webpack/update-parameter-store-plugin.mjs +++ b/webpack/update-parameter-store-plugin.mjs @@ -49,20 +49,16 @@ export class UpdateParameterStorePlugin { const output = JSON.stringify(cloudformation, null, 2); const outputPath = join( - import.meta.dirname, + compilation.outputOptions.path, '..', - 'dist', - 'riff-raff', 'cloudformation', `${stage}.json`, ); compiler.outputFileSystem.mkdirSync( join( - import.meta.dirname, + compilation.outputOptions.path, '..', - 'dist', - 'riff-raff', 'cloudformation', ), { recursive: true },