mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2025-12-08 17:36:16 +00:00
refactor: added ACI prefix to avoid external conflicts
This commit is contained in:
parent
0ba6025fb5
commit
ea4ab4c4eb
@ -82,7 +82,7 @@ const config = ({
|
||||
minimizer: [new TerserWebpackPlugin({ parallel: true })]
|
||||
},
|
||||
|
||||
plugins: [new DefinePlugin({ __DEV__: devBuild })]
|
||||
plugins: [new DefinePlugin({ __ACI_DEV__: devBuild })]
|
||||
});
|
||||
|
||||
module.exports = [
|
||||
|
||||
@ -25,10 +25,10 @@ declare global {
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
const __DEV__: boolean;
|
||||
const __ACI_DEV__: boolean;
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
if (__ACI_DEV__) {
|
||||
console.error(
|
||||
'You are using a development build. Make sure to use the correct build in production'
|
||||
);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
export {};
|
||||
|
||||
describe('tests __DEV__ usage', () => {
|
||||
it('expects importing with __DEV__ true prints a warning', async () => {
|
||||
expect(__DEV__).toBeTruthy();
|
||||
describe('tests __ACI_DEV__ usage', () => {
|
||||
it('expects importing with __ACI_DEV__ true prints a warning', async () => {
|
||||
expect(__ACI_DEV__).toBeTruthy();
|
||||
|
||||
const oldLog = console.error;
|
||||
console.error = jest.fn();
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
// @ts-expect-error __DEV__ is declared as const
|
||||
global.__DEV__ = true;
|
||||
// @ts-expect-error __ACI_DEV__ is declared as const
|
||||
global.__ACI_DEV__ = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user