Skip to content

Commit

Permalink
fix: windows builds (#9492)
Browse files Browse the repository at this point in the history
* fix: windows builds

* fix
  • Loading branch information
runspired authored Jun 17, 2024
1 parent c809f9f commit 2c99876
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/vite/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function createConfig(options, resolve) {
build: {
outDir: 'dist',
emptyOutDir: options.emptyOutDir ?? true,
target: ['esnext', 'firefox121'],
target: options.target ?? ['esnext', 'firefox121'],
minify: false,
sourcemap: true,
lib: {
Expand Down
5 changes: 3 additions & 2 deletions packages/build-config/src/-private/utils/features.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

import * as CURRENT_FEATURES from '../../canary-features.ts';
type FEATURE = keyof typeof CURRENT_FEATURES;

const dirname = new URL(import.meta.url).pathname;
const relativePkgPath = path.join(dirname, '../../package.json');
const dirname = typeof __dirname !== 'undefined' ? __dirname : fileURLToPath(new URL('.', import.meta.url));
const relativePkgPath = path.join(dirname, '../package.json');

const version = JSON.parse(fs.readFileSync(relativePkgPath, 'utf-8')).version;
const isCanary = version.includes('alpha');
Expand Down
3 changes: 2 additions & 1 deletion packages/build-config/vite.config-cjs.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createConfig } from '@warp-drive/internal-config/vite/config.js';

export const externals = ['babel-import-util', 'fs', 'path'];
export const externals = ['babel-import-util', 'fs', 'path', 'url'];

export const entryPoints = [
'./cjs-src/transforms/babel-plugin-transform-asserts.js',
Expand All @@ -17,6 +17,7 @@ export default createConfig(
flatten: true,
format: 'cjs',
externals,
target: ['esnext', 'firefox121', 'node18'],
emptyOutDir: false,
fixModule: false,
compileTypes: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/build-config/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createConfig } from '@warp-drive/internal-config/vite/config.js';

export const externals = ['fs', 'path', 'semver'];
export const externals = ['fs', 'path', 'semver', 'url'];

export const entryPoints = [
'./src/index.ts',
Expand Down

0 comments on commit 2c99876

Please sign in to comment.