Skip to content

Commit

Permalink
sideEffects
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Jan 17, 2025
1 parent 0df21b4 commit 1d213c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const TARGET_DIR_ESM = path.resolve(currentDirectory, '../build/esm');
async function run() {
await fs.writeFile(
path.resolve(TARGET_DIR_ESM, 'package.json'),
JSON.stringify({ type: 'module' }),
JSON.stringify({ type: 'module', sideEffects: false }),
'utf8',
);
}
Expand Down
9 changes: 6 additions & 3 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ async function run(argv) {
'**/test-cases/*.*',
];

let outFileExtension = '.js';
const outFileExtension = '.js';

let relativeOutDir = {
const relativeOutDir = {
node: './',
modern: './modern',
stable: './esm',
Expand Down Expand Up @@ -111,7 +111,10 @@ async function run(argv) {
const isEsm = bundle === 'modern' || bundle === 'stable';
if (isEsm) {
const rootBundlePackageJson = path.join(outDir, 'package.json');
await fs.writeFile(rootBundlePackageJson, JSON.stringify({ type: 'module' }));
await fs.writeFile(
rootBundlePackageJson,
JSON.stringify({ type: 'module', sideEffects: false }),
);
}

if (verbose) {
Expand Down

0 comments on commit 1d213c8

Please sign in to comment.