Skip to content

Commit

Permalink
Fix theme package (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding authored Sep 24, 2024
1 parent 1f17a37 commit dca2d04
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-carrots-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@jpmorganchase/mosaic-theme': patch
---

Added type:module to the package.json
5 changes: 3 additions & 2 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"url": "[email protected]:jpmorganchase/mosaic.git",
"directory": "packages/theme"
},
"type": "module",
"types": "./dist/index.d.ts",
"style": "./dist/index.css",
"exports": {
Expand All @@ -28,11 +29,11 @@
],
"scripts": {
"build": "npm-run-all --parallel build:*",
"build:bundle": "node ./scripts/bundle.js",
"build:bundle": "node ./scripts/bundle.mjs",
"build:types": "tsc",
"clean": "npx del-cli 'dist/**' && find . -type d -empty -delete",
"lint": "eslint --ignore-pattern \"**/__tests__/**\"",
"dev": "node ./scripts/bundle.js watch"
"dev": "node ./scripts/bundle.mjs watch"
},
"devDependencies": {
"@vanilla-extract/esbuild-plugin": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const path = require('path');
const esbuild = require('esbuild');
const { vanillaExtractPlugin } = require('@vanilla-extract/esbuild-plugin');
const glob = require('fast-glob');
import esbuild from 'esbuild';
import { vanillaExtractPlugin } from '@vanilla-extract/esbuild-plugin';
import glob from 'fast-glob';

const publicImageResolver = require('./publicImageResolver');
const saltIconNames = require('./saltIconNames');
import { publicImageResolver } from './publicImageResolver.mjs';
import { saltIconNames } from './saltIconNames.mjs';

const args = process.argv.slice(2);
const watchEnabled = args[0] === 'watch';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const path = require('path');
const fs = require('fs');
import path from 'node:path';
import fs from 'node:fs';

const publicPath = path.join(process.cwd(), 'src/assets');

const publicImageResolver = {
export const publicImageResolver = {
name: 'imagePlugin',
setup(build) {
build.onResolve({ filter: /^img_/ }, args => ({
Expand All @@ -18,5 +18,3 @@ const publicImageResolver = {
});
}
};

module.exports = publicImageResolver;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const path = require('path');
import fs from 'node:fs';
import path from 'node:path';

const typesPath = path.join(process.cwd(), 'types/saltIconNames.d.ts');

Expand All @@ -13,7 +13,7 @@ ${iconItems.join('\n')};
`;
}

const saltIconNames = {
export const saltIconNames = {
name: 'iconEnum',
setup(build) {
const icons = [];
Expand All @@ -31,5 +31,3 @@ const saltIconNames = {
});
}
};

module.exports = saltIconNames;

0 comments on commit dca2d04

Please sign in to comment.