UNPKG

@alleyinteractive/build-tool

Version:

An opinionated set of build configurations for wp-scripts

31 lines 1.08 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const node_child_process_1 = require("node:child_process"); const node_process_1 = require("node:process"); // eslint-disable-next-line import/no-unresolved const utils_1 = require("./utils"); /** * The default arguments to pass to wp-scripts. */ const defaultArgs = (0, utils_1.getDefaultArgs)() || []; /** * Set the environment variable for the path to the webpack entries directory. * * @type {string|undefined} */ process.env.ENTRIES_DIRECTORY = (0, utils_1.hasArgInCLI)('--webpack-entries-dir') ? (0, utils_1.getArgFromCLI)('--webpack-entries-dir') : 'entries'; /** * Set the environment variable to only build blocks. */ process.env.BLOCKS_ONLY = (0, utils_1.hasArgInCLI)('--webpack-blocks-only') ? 'true' : 'false'; // Call wp-scripts with the default arguments. (0, node_child_process_1.spawn)('wp-scripts', [ ...node_process_1.argv.slice(2), ...defaultArgs, ], { cwd: (0, node_process_1.cwd)(), stdio: 'inherit', }); //# sourceMappingURL=index.js.map