Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Commit

Permalink
Put back index fix and removed CDN for now
Browse files Browse the repository at this point in the history
  • Loading branch information
christianalfoni committed Apr 3, 2017
1 parent 69e6dc3 commit 0eda146
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/webpack-sandbox-prod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"clientOrigin": "https://www.webpackbin.com",
"sessionsCleanInterval": 300000,
"sessionsMaxAge": 1800000,
"dllServiceUrl": "https://cdn.jsdelivr.net/webpack",
"dllServiceUrl": "https://webpack-dll-prod.herokuapp.com",
"cookie": {
"maxAge": 1800000,
"secure": true
Expand Down
9 changes: 8 additions & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,16 @@ var utils = {
createExternals: function (packages, manifest) {
return Object.keys(manifest.content).reduce(function (externals, manifestKey, index) {
var directPath = manifestKey.substr(2).split('/').slice(1).join('/');
var fileName = path.basename(directPath)
var extName = path.extname(directPath)
var baseName = path.basename(fileName, extName)

externals[directPath] = 'dll_bundle(' + manifest.content[manifestKey] + ')';
externals[path.dirname(directPath) + '/' + path.basename(directPath, path.extname(path.basename(directPath)))] = 'dll_bundle(' + manifest.content[manifestKey] + ')';
externals[path.dirname(directPath) + '/' + baseName] = 'dll_bundle(' + manifest.content[manifestKey] + ')';

if (!directPath.match(/node_modules/) && fileName === 'index.js') {
externals[path.dirname(directPath)] = 'dll_bundle(' + manifest.content[manifestKey] + ')';
}

return externals;
}, {});
Expand Down

0 comments on commit 0eda146

Please sign in to comment.