@foxglove/fox
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -26,2 +26,3 @@ "use strict"; | ||
exports.buildCommand = void 0; | ||
const fs_1 = require("fs"); | ||
const path = __importStar(require("path")); | ||
@@ -31,2 +32,5 @@ const webpack_1 = __importDefault(require("webpack")); | ||
const webpackConfigExtension_1 = __importDefault(require("./webpackConfigExtension")); | ||
function objectIsWebpackConfig(obj) { | ||
return typeof obj === "object" && obj != undefined && "webpack" in obj; | ||
} | ||
async function buildCommand(options = {}) { | ||
@@ -36,3 +40,12 @@ const env = options.mode ?? (process.env.NODE_ENV === "production" ? "production" : "development"); | ||
const entryPoint = options.entryPoint ?? "./src/index.ts"; | ||
const compiler = webpack_1.default(webpackConfigExtension_1.default(extensionPath, entryPoint, env)); | ||
const configPath = path.join(extensionPath, "config.ts"); | ||
let webpackConfig = webpackConfigExtension_1.default(extensionPath, entryPoint, env); | ||
if (fs_1.existsSync(configPath)) { | ||
log_1.info(`Using config file at ${configPath}`); | ||
const config = await Promise.resolve().then(() => __importStar(require(configPath))); | ||
if (objectIsWebpackConfig(config)) { | ||
webpackConfig = config.webpack(webpackConfig); | ||
} | ||
} | ||
const compiler = webpack_1.default(webpackConfig); | ||
return new Promise((resolve, reject) => { | ||
@@ -39,0 +52,0 @@ log_1.info("Building..."); |
@@ -28,3 +28,3 @@ "use strict"; | ||
let tmpdir; | ||
jest.setTimeout(60 * 1000); | ||
jest.setTimeout(120 * 1000); | ||
jest.mock("./log.ts", () => ({ | ||
@@ -31,0 +31,0 @@ info: jest.fn(), |
{ | ||
"name": "@foxglove/fox", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"publisher": "foxglove", | ||
@@ -5,0 +5,0 @@ "description": "Foxglove Studio Extension Manager", |
@@ -36,2 +36,17 @@ # fox | ||
You can customize the build and install process by editing your `./config.ts` file. The config file should | ||
look something like this: | ||
``` | ||
module.exports = { | ||
webpack: (config) => { | ||
config.module.rules.push({ | ||
test: /\.css$/i, | ||
use: ["style-loader", "css-loader"], | ||
}); | ||
return config; | ||
}, | ||
}; | ||
``` | ||
## Publishing Your Extension | ||
@@ -38,0 +53,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
74879
970
64
2
9