chore: add clipper extension package (#2281)

This commit is contained in:
Aman Harwara
2023-04-11 22:14:02 +05:30
committed by GitHub
parent 0b0466c9fa
commit 4f5e634685
214 changed files with 3163 additions and 355 deletions

View File

@@ -8,6 +8,23 @@ require('dotenv').config()
module.exports = (env) => {
mergeWithEnvDefaults(env)
const copyPluginPatterns = [
{ from: 'src/favicon', to: 'favicon' },
{ from: 'src/vendor', to: 'dist' },
{ from: 'src/404.html' },
{ from: 'src/422.html' },
{ from: 'src/500.html' },
{ from: 'src/index.html' },
{ from: 'src/manifest.webmanifest' },
{ from: 'src/robots.txt' },
{ from: 'src/.well-known', to: '.well-known' },
]
if (process.env.BUILD_TARGET !== 'clipper') {
copyPluginPatterns.push({ from: 'src/components', to: 'components' })
}
return {
entry: './src/javascripts/index.ts',
output: {
@@ -36,18 +53,7 @@ module.exports = (env) => {
ignoreOrder: true, // Enable to remove warnings about conflicting order
}),
new CopyWebpackPlugin({
patterns: [
{ from: 'src/favicon', to: 'favicon' },
{ from: 'src/vendor', to: 'dist' },
{ from: 'src/components', to: 'components' },
{ from: 'src/404.html' },
{ from: 'src/422.html' },
{ from: 'src/500.html' },
{ from: 'src/index.html' },
{ from: 'src/manifest.webmanifest' },
{ from: 'src/robots.txt' },
{ from: 'src/.well-known', to: '.well-known' },
],
patterns: copyPluginPatterns,
}),
],
resolve: {