From d4ea9d745431bd564a4c8ec403eabbc63daf4193 Mon Sep 17 00:00:00 2001 From: jakub-roch <70572646+jakub-roch@users.noreply.github.com> Date: Tue, 9 Apr 2024 08:19:04 +0200 Subject: [PATCH] build: add default profiles json files to build output in es version (#603) * build: add default profiles json files to build output in es version * build: simplify profiles path --- webpack/es6.config.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/webpack/es6.config.js b/webpack/es6.config.js index d45a3d96..4ac398c9 100644 --- a/webpack/es6.config.js +++ b/webpack/es6.config.js @@ -1,9 +1,12 @@ const { merge } = require('webpack-merge'); const webpackCommon = require('./common.config'); const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); delete webpackCommon.output; // overwrite +const outputPath = path.resolve(__dirname, '../lib'); + module.exports = merge(webpackCommon, { mode: 'production', @@ -16,7 +19,7 @@ module.exports = merge(webpackCommon, { output: { filename: '[name].js', - path: path.resolve(__dirname, '../lib'), + path: outputPath, chunkFilename: '[name].js', publicPath: '', library: { @@ -24,6 +27,15 @@ module.exports = merge(webpackCommon, { } }, + plugins: [ + new CopyWebpackPlugin({ + patterns: [{ + from: path.resolve(__dirname, '../src/config/profiles'), + to: `${outputPath}/profiles` + }] + }) + ], + experiments: { outputModule: true }