Skip to content

Commit

Permalink
Merge pull request #55 from chuckdumont/master
Browse files Browse the repository at this point in the history
Upgrade to dojo-webpack-plugin 2.3.2 and Dojo 1.13.0
  • Loading branch information
chuckdumont authored Dec 27, 2017
2 parents a3fe5ea + 7d0a693 commit 8903a3b
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion js/loaderConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ if (typeof module !== 'undefined' && module) {
module.exports = getConfig;
} else {
// No webpack. This script was loaded by page via script tag, so load Dojo from CDN
getConfig({dojoRoot: '//ajax.googleapis.com/ajax/libs/dojo/1.12.2'});
getConfig({dojoRoot: '//ajax.googleapis.com/ajax/libs/dojo/1.13.0'});
}
12 changes: 6 additions & 6 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.1",
"version": "2.3.2",
"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.1",
"dijit": "1.13.0",
"dojo": "1.13.0",
"dojo-util": "1.13.0",
"dojo-webpack-plugin": "2.3.2",
"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.8.1"
"webpack": "3.10.0"
},
"license": "Apache-2.0",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion test.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<script type="text/javascript">
if (/[?&]nopack=(1|true)/i.test(location.search)) {
document.write("<script type=\"text/javascript\" src=\"js/loaderConfig.js\" charset=\"utf-8\"><" + "/script>");
document.write("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/dojo/1.12.2/dojo/dojo.js.uncompressed.js\" charset=\"utf-8\"><" + "/script>");
document.write("<script type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/dojo/1.13.0/dojo/dojo.js.uncompressed.js\" charset=\"utf-8\"><" + "/script>");
} else {
document.write("<script type=\"text/javascript\" src=\"release/bundle.js\" charset=\"utf-8\"><" + "/script>");
}
Expand Down
146 changes: 73 additions & 73 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
/*
* (C) Copyright IBM Corp. 2012, 2016 All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var DojoWebpackPlugin = require("dojo-webpack-plugin");
var CopyWebpackPlugin = require("copy-webpack-plugin");
/*
* (C) Copyright IBM Corp. 2012, 2016 All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var DojoWebpackPlugin = require("dojo-webpack-plugin");
var CopyWebpackPlugin = require("copy-webpack-plugin");

var path = require("path");
var webpack = require("webpack");

module.exports = {
context: __dirname,
entry: "js/bootstrap",
output: {
path: path.join(__dirname, "release"),
publicPath: "release/",
pathinfo: true,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.(png)|(gif)$/, loader: "url-loader?limit=100000" }
]
},
plugins: [
new DojoWebpackPlugin({
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"),
new webpack.NormalModuleReplacementPlugin(
/^css!/, function(data) {
data.request = data.request.replace(/^css!/, "!style-loader!css-loader!less-loader!")
}
),

var path = require("path");
var webpack = require("webpack");

module.exports = {
context: __dirname,
entry: "js/bootstrap",
output: {
path: path.join(__dirname, "release"),
publicPath: "release/",
pathinfo: true,
filename: "bundle.js"
},
module: {
loaders: [
{ test: /\.(png)|(gif)$/, loader: "url-loader?limit=100000" }
]
},
plugins: [
new DojoWebpackPlugin({
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"),
new webpack.NormalModuleReplacementPlugin(
/^css!/, function(data) {
data.request = data.request.replace(/^css!/, "!style-loader!css-loader!less-loader!")
}
),

new webpack.optimize.UglifyJsPlugin({
output: {comments: false},
compress: {warnings: false},
sourceMap: true
})
],
resolveLoader: {
modules: ["node_modules"]
},
devtool: "#source-map",
node: {
process: false,
global: false
}
};
new webpack.optimize.UglifyJsPlugin({
output: {comments: false},
compress: {warnings: false},
sourceMap: true
})
],
resolveLoader: {
modules: ["node_modules"]
},
devtool: "#source-map",
node: {
process: false,
global: false
}
};

0 comments on commit 8903a3b

Please sign in to comment.