mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2025-12-08 17:36:16 +00:00
feat: MIT copyright notice on bundle
This commit is contained in:
parent
00fdff0158
commit
f842c36b9d
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 - present Arthur Fiorette
|
||||
Copyright (c) 2021-present Arthur Fiorette & Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
software and associated documentation files (the "Software"), to deal in the Software
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
const path = require('path');
|
||||
const TerserWebpackPlugin = require('terser-webpack-plugin');
|
||||
const { DefinePlugin } = require('webpack');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { version } = require('../package.json');
|
||||
|
||||
const COPYRIGHT = `// Axios Cache Interceptor v${version} MIT License Copyright (c) 2021-present Arthur Fiorette & Contributors\n`;
|
||||
|
||||
/** @type {(...args: string[]) => string} */
|
||||
const root = (...p) => path.resolve(__dirname, '..', ...p);
|
||||
@ -84,7 +88,29 @@ const config = ({
|
||||
minimizer: [new TerserWebpackPlugin({ parallel: true })]
|
||||
},
|
||||
|
||||
plugins: [new DefinePlugin({ __ACI_DEV__: devBuild })]
|
||||
plugins: [
|
||||
// Chooses the right environment
|
||||
new DefinePlugin({ __ACI_DEV__: devBuild }),
|
||||
|
||||
// Add a banner to the top of each file
|
||||
{
|
||||
apply: (compiler) => {
|
||||
compiler.hooks.emit.tapAsync('FileListPlugin', (comp, cb) => {
|
||||
for (const chunk of comp.chunks) {
|
||||
for (const filename of chunk.files) {
|
||||
const assets = comp.assets[filename];
|
||||
|
||||
// @ts-expect-error - _value is not a public property
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
||||
assets._value = COPYRIGHT + assets._value;
|
||||
}
|
||||
}
|
||||
|
||||
cb();
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
module.exports = [
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
"resolveJsonModule": false, /* Enable importing .json files */
|
||||
"resolveJsonModule": true, /* Enable importing .json files */
|
||||
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
||||
|
||||
/* JavaScript Support */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user