{"id":25158,"library":"dash-compiler","title":"Dash Compiler","description":"A fast, platform-agnostic compiler for Minecraft Add-Ons, replacing bridge.'s old internal compiler since v2.2.0. Current stable version is 0.10.10, with regular releases. It supports standalone builds for Deno and ships TypeScript types. Unlike other tools, it is designed specifically for Minecraft Add-On compilation, focusing on speed and reliability across platforms.","status":"active","version":"0.10.10","language":"javascript","source_language":"en","source_url":"https://github.com/bridge-core/dash-compiler","tags":["javascript","typescript"],"install":[{"cmd":"npm install dash-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add dash-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add dash-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package; require() will fail.","wrong":"const { compile } = require('dash-compiler')","symbol":"compile","correct":"import { compile } from 'dash-compiler'"},{"note":"Type-only import; use 'import type' for correct usage with isolatedModules.","wrong":"import { DashCompilerOptions } from 'dash-compiler'","symbol":"DashCompilerOptions","correct":"import type { DashCompilerOptions } from 'dash-compiler'"},{"note":"Default export is a class; use default import for instantiation.","wrong":"import { default as DashCompiler } from 'dash-compiler'","symbol":"default","correct":"import DashCompiler from 'dash-compiler'"}],"quickstart":{"code":"import { compile } from 'dash-compiler';\n\nasync function main() {\n  const options = {\n    input: './src',\n    output: './dist',\n    minify: true,\n    watch: false,\n  };\n  const result = await compile(options);\n  console.log('Compilation successful:', result.files);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Demonstrates basic usage of the compile function with options object and async/await."},"warnings":[{"fix":"Use async/await or .then() instead of a callback.","message":"BREAKING CHANGE: As of v0.10.0, the compile function no longer accepts a callback; it returns a Promise.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Replace 'verbose: true' with 'logLevel: 'debug'.","message":"Deprecated: The 'verbose' option has been removed in v0.9.0. Use 'logLevel' instead.","severity":"deprecated","affected_versions":">=0.9.0"},{"fix":"Use import syntax or ensure your project is configured for ESM.","message":"The package is ESM-only. CommonJS require() will throw a Module not found error.","severity":"gotcha","affected_versions":">=0.8.0"},{"fix":"Update tsconfig.json: { compilerOptions: { moduleResolution: 'node16' } }","message":"When using TypeScript, you must set 'moduleResolution' to 'node16' or 'nodenext' in tsconfig.json to resolve types correctly.","severity":"gotcha","affected_versions":">=0.10.0"},{"fix":"Parse output with the provided 'parseOutput' utility from 'dash-compiler/utils'.","message":"BREAKING CHANGE: The output format changed in v0.8.0 from JSON to a custom binary format for performance.","severity":"breaking","affected_versions":">=0.8.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install dash-compiler and use import { compile } from 'dash-compiler'","cause":"Using require() instead of import, or missing package installation.","error":"Module not found: Can't resolve 'dash-compiler'"},{"fix":"Use import dashCompiler from 'dash-compiler' and call dashCompiler.compile()","cause":"Destructuring the default export incorrectly.","error":"TypeError: compile is not a function"},{"fix":"Set 'moduleResolution' to 'node16' in tsconfig.json and ensure 'types' field includes 'node'.","cause":"TypeScript resolution issue due to ESM module configuration.","error":"error TS2307: Cannot find module 'dash-compiler' or its corresponding type declarations."},{"fix":"Reinstall package: rm -rf node_modules/dash-compiler && npm install","cause":"Using an outdated version or corrupt installation.","error":"Error: Cannot find module './dist/compile' imported from 'dash-compiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}