1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 | exports.nodeResolvePlugin = void 0;
|
7 | const dev_server_rollup_1 = require("@web/dev-server-rollup");
|
8 | const deepmerge_1 = __importDefault(require("deepmerge"));
|
9 | function nodeResolvePlugin(rootDir, preserveSymlinks, userOptions) {
|
10 | const userOptionsObject = typeof userOptions === 'object' ? userOptions : {};
|
11 | const options = (0, deepmerge_1.default)({
|
12 | rootDir,
|
13 | extensions: ['.mjs', '.js', '.cjs', '.jsx', '.json', '.ts', '.tsx'],
|
14 | moduleDirectories: ['node_modules', 'web_modules'],
|
15 |
|
16 | preferBuiltins: false,
|
17 | }, userOptionsObject);
|
18 |
|
19 | options.exportConditions = userOptionsObject.exportConditions || ['development'];
|
20 | return (0, dev_server_rollup_1.rollupAdapter)((0, dev_server_rollup_1.nodeResolve)(options), { preserveSymlinks }, { throwOnUnresolvedImport: true });
|
21 | }
|
22 | exports.nodeResolvePlugin = nodeResolvePlugin;
|
23 |
|
\ | No newline at end of file |