1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.esbuildPlugin = void 0;
|
4 | function requirePlugin() {
|
5 | try {
|
6 | const path = require.resolve('@web/dev-server-esbuild', { paths: [__dirname, process.cwd()] });
|
7 | return require(path);
|
8 | }
|
9 | catch (error) {
|
10 | if (error.code === 'MODULE_NOT_FOUND') {
|
11 | throw new Error('You need to add @web/dev-server-esbuild as a dependency of your project to use the esbuild flags.');
|
12 | }
|
13 | else {
|
14 | throw error;
|
15 | }
|
16 | }
|
17 | }
|
18 | function esbuildPlugin(target) {
|
19 | const pluginModule = requirePlugin();
|
20 | return pluginModule.esbuildPlugin({ target });
|
21 | }
|
22 | exports.esbuildPlugin = esbuildPlugin;
|
23 |
|
\ | No newline at end of file |