-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed build for global and npm usages
- Loading branch information
1 parent
020d35e
commit 6a1815b
Showing
11 changed files
with
73 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules/ | ||
lib/ | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dist/ | ||
example/ | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc | ||
.travis | ||
index.html | ||
webpack.config.js | ||
webpack.dev.config.js | ||
webpack.lib.config.js | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict'; | ||
const path = require('path'); | ||
const webpackBaseConfig = require('./webpack.config'); | ||
|
||
// Plugins | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||
|
||
module.exports = | ||
Object.assign(webpackBaseConfig, { | ||
output: Object.assign(webpackBaseConfig.output, { | ||
path: path.join(__dirname, 'lib'), | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true | ||
}), | ||
module: Object.assign(webpackBaseConfig.module, { | ||
loaders: webpackBaseConfig.module.loaders.map(loaderObj => { | ||
const loaderTestString = loaderObj.test.toString(); | ||
if (loaderTestString === /\.(png|ttf)$/.toString()) { | ||
return Object.assign(loaderObj, { | ||
loader: 'file?name=../[path][name].[ext]' // So it won't copy the file to lib folder, only point to it's own location | ||
}); | ||
} else { | ||
return loaderObj; | ||
} | ||
}) | ||
}) | ||
}); |