芝麻web文件管理V1.00
编辑当前文件:/home/rejoandoctor/public_html/node_modules/laravel-mix/src/components/Define.js
const { Component } = require('./Component'); /** @typedef {undefined | null | string | number | bigint | boolean} CodeValuePrimitive */ /** @typedef {() => CodeValuePrimitive} LazyCodeValue */ /** @typedef {CodeValuePrimitive | LazyCodeValue} CodeValue */ module.exports = class Define extends Component { /** * @type {Record
} * @internal **/ definitions = {}; /** * * @param {Record
} definitions */ register(definitions) { this.definitions = { ...this.definitions, ...definitions }; } /** @internal */ get defaults() { return { 'import.meta.env.PROD': () => this.context.api.inProduction(), 'import.meta.env.DEV': () => !this.context.api.inProduction() }; } /** * @param {Record
} definitions */ resolve(definitions) { for (const [key, value] of Object.entries(definitions)) { if (typeof value === 'function') { definitions[key] = value(); } } return definitions; } webpackPlugins() { const { DefinePlugin } = require('webpack'); return [ new DefinePlugin( this.resolve({ ...this.defaults, ...this.definitions }) ) ]; } };