Skip to content

Commit

Permalink
fix: normalize umd bundle name after scope addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Mar 27, 2017
1 parent 3e73f9b commit 73ab65f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions webpack.config.js
@@ -1,7 +1,8 @@
const { resolve } = require('path');
const webpack = require('webpack');

const { name: packageName } = require('./package.json');
const packageJSON = require('./package.json');
const packageName = normalizePackageName(packageJSON.name);

const PATHS = {
entryPoint: resolve(__dirname, 'src/index.ts'),
Expand Down Expand Up @@ -70,8 +71,9 @@ const config = (env) => {
// we don't want any declaration file in the bundles
// folder since it wouldn't be of any use ans the source
// map already include everything for debugging

// This cannot be set because -> Option 'declarationDir' cannot be specified without specifying option 'declaration'.
// declaration: false,
configFileName: 'tsconfig.base.json',
}
}],
}]
Expand Down Expand Up @@ -99,3 +101,9 @@ function toUpperCase(myStr) {
function pascalCase(myStr) {
return toUpperCase(dashToCamelCase(myStr));
}

function normalizePackageName(rawPackageName){
const scopeEnd = rawPackageName.indexOf('/') + 1;

return rawPackageName.substring(scopeEnd);
}

0 comments on commit 73ab65f

Please sign in to comment.