Registry / web-framework / dojo-webpack-plugin

dojo-webpack-plugin

JSON →
library3.0.9jsnpmunverified

Webpack plugin for building Dojo 1.x AMD applications with webpack 5. Current stable version is 3.0.9, maintained on GitHub by OpenNTF. Released continuously with bug fixes and security updates. Differentiators: resolves Dojo AMD modules via webpack, supports synchronous and asynchronous require in packed code, embeds a stripped-down Dojo loader at ~1.5KB for runtime require resolution, handles dojo/text, dojo/has, dojo/i18n loaders, and respects loader config (baseUrl, paths, packages, map, aliases). Requires webpack >=5, tapable >=2, webpack-sources >=2. Alternative to using Dojo's own build system with webpack.

npm install dojo-webpack-plugin
INSTALL
IMPORT
SIG · DOJO-WEBPACK-PLUGI
D
dojo-webpack-plugin
web-frameworkjavascriptv3.0.9
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DojoWebpackPlugin
import DojoWebpackPlugin from 'dojo-webpack-plugin'
const DojoWebpackPlugin = require('dojo-webpack-plugin')
Default export. Requires ESM or compatible bundler. CommonJS require() works if using strict CommonJS but not recommended.
DojoWebpackPlugin
const DojoWebpackPlugin = require('dojo-webpack-plugin').default
const DojoWebpackPlugin = require('dojo-webpack-plugin')
CommonJS users must access .default because the package exports ESM default. Without .default, you get the module object.
DojoWebpackPlugin.Options
import type { Options } from 'dojo-webpack-plugin'
const { Options } = require('dojo-webpack-plugin')
TypeScript type export; not available at runtime. Use type import only.

Shows how to configure the plugin in a webpack config with Dojo loader settings including baseUrl, packages, async, locales, and environment.

// webpack.config.js import DojoWebpackPlugin from 'dojo-webpack-plugin'; export default { entry: './src/main.js', output: { path: './dist', filename: 'bundle.js' }, plugins: [ new DojoWebpackPlugin({ loaderConfig: { baseUrl: './src', packages: [ { name: 'dojo', location: 'node_modules/dojo' }, { name: 'app', location: '.' } ], async: true }, environment: { dojoConfig: 'path/to/dojoConfig.js' }, locales: ['en-us', 'fr'] }) ], module: { rules: [ { test: /\.html$/, loader: 'raw-loader' } ] } };
Debug
Known issues
breakingVersion 3.0.0 only supports webpack 5. Users on webpack 4 must use the v2x branch.
fix
Upgrade to webpack 5 or use dojo-webpack-plugin@2.x from the v2x branch.
affects: ^3.0.0
gotchaThe plugin embeds a custom build of the Dojo loader at build time; the Dojo source must be resolvable in node_modules or via loaderConfig. Without it, the build may fail with missing module errors.
fix
Ensure the Dojo toolkit is installed (npm install dojo) and referenced in loaderConfig.packages.
affects: >=3.0.0
gotchaThe default export is ESM-only. Using require('dojo-webpack-plugin') without .default returns the module object, not the constructor.
fix
Use import syntax or require('dojo-webpack-plugin').default.
affects: >=3.0.0
deprecatedThe 'coerceUndefinedToFalse' option is deprecated and may be removed in future releases.
fix
Avoid using this option or handle undefined values explicitly in your code.
affects: ^3.0.0
gotchaThe plugin uses a stripped-down loader for runtime require calls; synchronous require with non-static expressions may not work as expected.
fix
Use static require expressions or async require for dynamic module loading.
affects: >=3.0.0
breakingIn v3.0.0, support for webpack 4 was dropped; plugin options related to webpack 4 hooks may be ignored.
fix
Review plugin options for webpack 5 compatibility; remove any outdated options.
affects: ^3.0.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve 'dojo'
Dojo toolkit is not installed or not referenced in loaderConfig.
fix
npm install dojo and add { name: 'dojo', location: 'node_modules/dojo' } to loaderConfig.packages.
TypeError: DojoWebpackPlugin is not a constructor
Using require() without .default when the package exports ESM default.
fix
Use const DojoWebpackPlugin = require('dojo-webpack-plugin').default;
Error: Dojo loader not found. Ensure Dojo is installed or provide 'loader' option.
The plugin cannot locate the Dojo loader source at build time.
fix
Verify Dojo is installed in node_modules/dojo or specify a custom loader path via the 'loader' option in the plugin config.
Cannot read property 'getChunkModules' of undefined
Conflict with mini-css-extract-plugin or other plugins that modify chunk modules.
fix
Upgrade to dojo-webpack-plugin >=3.0.3 which fixes this issue.
Upgrade
Version history
3.0.9latest on npm
Audit
Dependencies
webpackrequiredwebpack >=5.0.0 is a peer dependency required for the plugin to operate
tapablerequiredtapable >=2.0 is a peer dependency used for plugin integration
webpack-sourcesrequiredwebpack-sources >=2.0 is a peer dependency for source manipulation
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources