Skip to content

Commit

Permalink
make esbuild script esm compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
frontendphil committed Oct 17, 2024
1 parent 071de88 commit 27c568e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions extension/esbuild.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// @ts-check
const esbuild = require('esbuild')
const cssModulesPlugin = require('esbuild-css-modules-plugin')
const plugin = require('node-stdlib-browser/helpers/esbuild/plugin')
const stdLibBrowser = require('node-stdlib-browser')
import esbuild from 'esbuild'
import cssModulesPlugin from 'esbuild-css-modules-plugin'
import stdLibBrowser from 'node-stdlib-browser'
import plugin from 'node-stdlib-browser/helpers/esbuild/plugin'
import { fileURLToPath } from 'url'

require('dotenv').config()
import { config } from 'dotenv'

config()

const SERVE_PORT = 3999

Expand Down Expand Up @@ -38,7 +40,11 @@ esbuild
target: ['chrome96'],
outdir: './public/build',
publicPath: '/build',
inject: [require.resolve('node-stdlib-browser/helpers/esbuild/shim')],
inject: [
fileURLToPath(
import.meta.resolve('node-stdlib-browser/helpers/esbuild/shim')
),
],
define: {
'process.env.LIVE_RELOAD':
process.env.NODE_ENV === 'development'
Expand Down

0 comments on commit 27c568e

Please sign in to comment.