Skip to content

Commit

Permalink
Revert back to commonjs modules
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed May 30, 2023
1 parent 5ecff0a commit 0692aa2
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .changeset/clean-queens-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@open-pioneer/build-package": patch
"@open-pioneer/build-support": patch
"@open-pioneer/build-common": patch
"@open-pioneer/vite-plugin-pioneer": patch
---

Revert back to commonjs
2 changes: 1 addition & 1 deletion packages/build-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.3.0",
"main": "dist/index.js",
"types": "types.d.ts",
"type": "module",
"type": "commonjs",
"license": "Apache-2.0",
"scripts": {
"clean": "rimraf dist temp",
Expand Down
2 changes: 1 addition & 1 deletion packages/build-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.2.1",
"main": "dist/index.js",
"types": "types.d.ts",
"type": "module",
"type": "commonjs",
"license": "Apache-2.0",
"scripts": {
"clean": "rimraf dist temp",
Expand Down
5 changes: 5 additions & 0 deletions packages/build-support/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// SPDX-FileCopyrightText: con terra GmbH and contributors
// SPDX-License-Identifier: Apache-2.0
exports.defineBuildConfig = function defineBuildConfig(config) {
return config;
};
5 changes: 5 additions & 0 deletions packages/build-support/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"version": "0.5.0",
"license": "Apache-2.0",
"type": "module",
"exports": {
"import": "./index.js",
"require": "./index.cjs",
"types": "./index.d.ts"
},
"files": [
"index.js",
"index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.6.0",
"main": "dist/index.js",
"types": "types.d.ts",
"type": "module",
"type": "commonjs",
"license": "Apache-2.0",
"scripts": {
"clean": "rimraf dist temp",
Expand Down
3 changes: 2 additions & 1 deletion packages/vite-plugin/src/metadata/MetadataRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { readFile, realpath } from "fs/promises";
import { dirname, join } from "path";
import { PluginContext, RollupWarning } from "rollup";
import { PackageData, normalizePath, resolvePackageData } from "vite";
import { PackageData, normalizePath } from "vite";
import { ReportableError } from "../ReportableError";
import { createDebugger } from "../utils/debug";
import { fileExists, isInDirectory } from "../utils/fileUtils";
Expand Down Expand Up @@ -285,6 +285,7 @@ export class MetadataRepository {
}

const { packageName, optional } = loc.dependency;
const { resolvePackageData } = await import("vite");
const packageData = await resolvePackageData(
packageName,
loc.importedFrom,
Expand Down
2 changes: 1 addition & 1 deletion support/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function build(mode, customOptions) {
platform: "node",
packages: "external",
logLevel: "info",
format: "esm"
format: "cjs"
};

if (watch) {
Expand Down

0 comments on commit 0692aa2

Please sign in to comment.