Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/shopgun/shopgun-js-sdk i…
Browse files Browse the repository at this point in the history
…nto jl/offer-currency-and-fallback
  • Loading branch information
jrlarano committed Sep 17, 2024
2 parents b022d4a + 22de755 commit 49f0322
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
14 changes: 9 additions & 5 deletions esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {readFileSync} from 'fs';
import {writeFile} from 'fs/promises';
import nib from 'nib';
import path from 'path';
import stylus from 'stylus';
import ts from 'typescript';
import * as url from 'url';
import packageJson from './package.json' assert {type: 'json'};
Expand Down Expand Up @@ -73,8 +74,11 @@ const commonOptions = {
loader: {'.styl': 'empty'},
metafile: true
};
const stylus = stylusLoader({
stylusOptions: {import: [nib.path + '/nib/index.styl']}
const stylusPlugin = stylusLoader({
stylusOptions: {
import: [nib.path + '/nib/index.styl'],
define: [['flex-version', [new stylus.nodes.Ident('flex')]]]
}
});

switch (process.argv[2]) {
Expand All @@ -86,7 +90,7 @@ switch (process.argv[2]) {
outfile: path.join(distDir, output + '.js'),
platform: 'browser',
globalName: name && `self[${JSON.stringify(name)}]`,
plugins: [stylus],
plugins: [stylusPlugin],
metafile: true,
banner: {
js: "new EventSource('/esbuild').addEventListener('change', () => location.reload());"
Expand Down Expand Up @@ -121,7 +125,7 @@ switch (process.argv[2]) {
outfile: path.join(distDir, output + '.js'),
platform: 'browser',
globalName: `self[${JSON.stringify(name)}]`,
plugins: [stylus]
plugins: [stylusPlugin]
}),
name &&
build({
Expand All @@ -131,7 +135,7 @@ switch (process.argv[2]) {
outfile: path.join(distDir, output + '.min.js'),
platform: 'browser',
globalName: `self[${JSON.stringify(name)}]`,
plugins: [stylus]
plugins: [stylusPlugin]
}),
build({
...commonOptions,
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
"@playwright/browser-chromium": "^1.38.1",
"@types/jest": "^29.5.5",
"@types/mustache": "^4.2.3",
"@types/nib": "^1.1.2",
"@types/node": "^18.16.12",
"@types/stylus": "^0.48.43",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"app-root-path": "^3.1.0",
Expand Down

0 comments on commit 49f0322

Please sign in to comment.