{"id":19446,"library":"dojo-webpack-plugin","title":"dojo-webpack-plugin","description":"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.","status":"active","version":"3.0.9","language":"javascript","source_language":"en","source_url":"https://github.com/OpenNTF/dojo-webpack-plugin","tags":["javascript"],"install":[{"cmd":"npm install dojo-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add dojo-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add dojo-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"webpack >=5.0.0 is a peer dependency required for the plugin to operate","package":"webpack","optional":false},{"reason":"tapable >=2.0 is a peer dependency used for plugin integration","package":"tapable","optional":false},{"reason":"webpack-sources >=2.0 is a peer dependency for source manipulation","package":"webpack-sources","optional":false}],"imports":[{"note":"Default export. Requires ESM or compatible bundler. CommonJS require() works if using strict CommonJS but not recommended.","wrong":"const DojoWebpackPlugin = require('dojo-webpack-plugin')","symbol":"DojoWebpackPlugin","correct":"import DojoWebpackPlugin from 'dojo-webpack-plugin'"},{"note":"CommonJS users must access .default because the package exports ESM default. Without .default, you get the module object.","wrong":"const DojoWebpackPlugin = require('dojo-webpack-plugin')","symbol":"DojoWebpackPlugin","correct":"const DojoWebpackPlugin = require('dojo-webpack-plugin').default"},{"note":"TypeScript type export; not available at runtime. Use type import only.","wrong":"const { Options } = require('dojo-webpack-plugin')","symbol":"DojoWebpackPlugin.Options","correct":"import type { Options } from 'dojo-webpack-plugin'"}],"quickstart":{"code":"// webpack.config.js\nimport DojoWebpackPlugin from 'dojo-webpack-plugin';\n\nexport default {\n  entry: './src/main.js',\n  output: {\n    path: './dist',\n    filename: 'bundle.js'\n  },\n  plugins: [\n    new DojoWebpackPlugin({\n      loaderConfig: {\n        baseUrl: './src',\n        packages: [\n          { name: 'dojo', location: 'node_modules/dojo' },\n          { name: 'app', location: '.' }\n        ],\n        async: true\n      },\n      environment: { dojoConfig: 'path/to/dojoConfig.js' },\n      locales: ['en-us', 'fr']\n    })\n  ],\n  module: {\n    rules: [\n      { test: /\\.html$/, loader: 'raw-loader' }\n    ]\n  }\n};","lang":"typescript","description":"Shows how to configure the plugin in a webpack config with Dojo loader settings including baseUrl, packages, async, locales, and environment."},"warnings":[{"fix":"Upgrade to webpack 5 or use dojo-webpack-plugin@2.x from the v2x branch.","message":"Version 3.0.0 only supports webpack 5. Users on webpack 4 must use the v2x branch.","severity":"breaking","affected_versions":"^3.0.0"},{"fix":"Ensure the Dojo toolkit is installed (npm install dojo) and referenced in loaderConfig.packages.","message":"The 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.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Use import syntax or require('dojo-webpack-plugin').default.","message":"The default export is ESM-only. Using require('dojo-webpack-plugin') without .default returns the module object, not the constructor.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Avoid using this option or handle undefined values explicitly in your code.","message":"The 'coerceUndefinedToFalse' option is deprecated and may be removed in future releases.","severity":"deprecated","affected_versions":"^3.0.0"},{"fix":"Use static require expressions or async require for dynamic module loading.","message":"The plugin uses a stripped-down loader for runtime require calls; synchronous require with non-static expressions may not work as expected.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Review plugin options for webpack 5 compatibility; remove any outdated options.","message":"In v3.0.0, support for webpack 4 was dropped; plugin options related to webpack 4 hooks may be ignored.","severity":"breaking","affected_versions":"^3.0.0"}],"env_vars":null,"search_vec":"'1':10 '1.5':58 '2':82,86 '3.0.9':21 '5':16,80 'alias':77 'altern':87 'amd':12,38 'applic':13 'asynchron':45 'baseurl':73 'bug':30 'build':8,93 'code':49 'config':72 'continu':28 'current':17 'differenti':35 'dojo':2,9,37,55,90 'dojo-webpack-plugin':1 'dojo/has':66 'dojo/i18n':67 'dojo/text':65 'emb':50 'fix':31 'github':24 'handl':64 'javascript':97 'kb':59 'loader':56,68,71 'maintain':22 'map':76 'modul':39 'openntf':26 'pack':48 'packag':75 'path':74 'plugin':4,6 'releas':27 'requir':46,62,78 'resolut':63 'resolv':36 'respect':70 'runtim':61 'secur':33 'sourc':85 'stabl':18 'strip':53 'stripped-down':52 'support':42 'synchron':43 'system':94 'tapabl':81 'updat':34 'use':89 'version':19 'via':40 'webpack':3,5,15,41,79,84,96 'webpack-sourc':83 'x':11","created_at":"2026-04-25T11:17:50.784691+00:00","updated_at":"2026-04-25T11:17:50.784691+00:00","problems":[{"fix":"npm install dojo and add { name: 'dojo', location: 'node_modules/dojo' } to loaderConfig.packages.","cause":"Dojo toolkit is not installed or not referenced in loaderConfig.","error":"Module not found: Error: Can't resolve 'dojo'"},{"fix":"Use const DojoWebpackPlugin = require('dojo-webpack-plugin').default;","cause":"Using require() without .default when the package exports ESM default.","error":"TypeError: DojoWebpackPlugin is not a constructor"},{"fix":"Verify Dojo is installed in node_modules/dojo or specify a custom loader path via the 'loader' option in the plugin config.","cause":"The plugin cannot locate the Dojo loader source at build time.","error":"Error: Dojo loader not found. Ensure Dojo is installed or provide 'loader' option."},{"fix":"Upgrade to dojo-webpack-plugin >=3.0.3 which fixes this issue.","cause":"Conflict with mini-css-extract-plugin or other plugins that modify chunk modules.","error":"Cannot read property 'getChunkModules' of undefined","affected_versions":"<=3.0.2"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/OpenNTF/dojo-webpack-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/dojo-webpack-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","database","auth-security"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}