Skip to content

Commit

Permalink
Merge pull request #52 from chuckdumont/master
Browse files Browse the repository at this point in the history
Update to 2.2.1 of the plugin and use dojo-config-api:0 for smaller b…
  • Loading branch information
chuckdumont authored Nov 21, 2017
2 parents 6ab9430 + b772015 commit a3fe5ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion js/loaderConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
function getConfig(env) {
// env is set by the 'buildEnvronment' and/or 'environment' plugin options (see webpack.config.js),
// or by the code at the end of this file if using without webpack
// or by the code at the end of this file if using without webpack
dojoConfig = {
baseUrl: '.',
packages: [
Expand Down Expand Up @@ -50,6 +50,8 @@ function getConfig(env) {

async: true,

has: {'dojo-config-api': 0}, // Don't need the config API code in the embedded Dojo loader

fixupUrl: function(url) {
// Load the uncompressed versions of dojo/dijit/dojox javascript files when using the dojo loader.
// When using a webpack build, the dojo loader is not used for loading javascript files so this
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "dojo-webpack-plugin-sample",
"version": "2.2.0",
"version": "2.2.1",
"devDependencies": {
"copy-webpack-plugin": "4.1.1",
"css-loader": "0.25.0",
"dijit": "1.12.2",
"dojo": "1.12.2",
"dojo-util": "1.12.2",
"dojo-webpack-plugin": "2.2.0",
"dojo-webpack-plugin": "2.2.1",
"dojox": "1.12.2",
"less": "2.7.1",
"less-loader": "2.2.3",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "3.7.1"
"webpack": "3.8.1"
},
"license": "Apache-2.0",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ module.exports = {
},
plugins: [
new DojoWebpackPlugin({
loaderConfig: require.resolve("./js/loaderConfig"),
loaderConfig: require("./js/loaderConfig"),
environment: {dojoRoot: "release"}, // used at run time for non-packed resources (e.g. blank.gif)
buildEnvironment: {dojoRoot: "node_modules"}, // used at build time
locales: ["en"]
}),

// Copy non-packed resources needed by the app to the release directory
new CopyWebpackPlugin([{
context: "node_modules",
from: "dojo/resources/blank.gif",
to: "dojo/resources"
}]),

// For plugins registered after the DojoAMDPlugin, data.request has been normalized and
// resolved to an absMid and loader-config maps and aliases have been applied
new webpack.NormalModuleReplacementPlugin(/^dojox\/gfx\/renderer!/, "dojox/gfx/canvas"),
Expand All @@ -56,7 +56,7 @@ module.exports = {
data.request = data.request.replace(/^css!/, "!style-loader!css-loader!less-loader!")
}
),

new webpack.optimize.UglifyJsPlugin({
output: {comments: false},
compress: {warnings: false},
Expand Down

0 comments on commit a3fe5ea

Please sign in to comment.