Skip to content

Commit

Permalink
✨ feat: add charlotte build
Browse files Browse the repository at this point in the history
Signed-off-by: SimonShiki <[email protected]>
  • Loading branch information
SimonShiki committed Mar 17, 2024
1 parent 9394a8b commit a00e4c1
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { includeURLs } = require('./generate-helper');
const packageJSON = require('./package.json');
const process = require('node:process');

const base = {
const standalone = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
entry: './src/index.ts',
output: {
Expand Down Expand Up @@ -74,4 +74,28 @@ const base = {
]
};

module.exports = base;
const charlotte = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development',
target: 'web',
entry: './src/injector/inject.ts',
experiments: {
outputModule: true
},
output: {
library: {
type: 'module'
},
path: path.resolve(__dirname, 'dist'),
publicPath: './',
filename: 'eureka-charlotte.js'
},
resolve: standalone.resolve,
module: standalone.module,
plugins: [
new webpack.DefinePlugin({
__EUREKA_VERSION__: JSON.stringify(packageJSON.version)
})
]
}

module.exports = [standalone, charlotte];

0 comments on commit a00e4c1

Please sign in to comment.