-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea9a68d
commit a1c1028
Showing
4 changed files
with
50 additions
and
30 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,13 +1,7 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
|
||
mkdir -p dist | ||
|
||
NODE_ENV=production $RACKT_PATH/node_modules/.bin/browserify lib/main.js \ | ||
-t reactify \ | ||
-t browserify-shim \ | ||
-t envify \ | ||
--detect-globals false \ | ||
-s $COMPONENT_NAME > dist/$COMPONENT_FILE.js | ||
BUILD="$RACKT_PATH/node_modules/.bin/webpack --devtool source-map --config $RACKT_PATH/webpack.build.js" | ||
|
||
$RACKT_PATH/node_modules/.bin/uglifyjs dist/$COMPONENT_FILE.js \ | ||
--compress warnings=false > dist/$COMPONENT_FILE.min.js | ||
mkdir -p dist | ||
eval $BUILD | ||
eval "MINIFY=1 $BUILD" |
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,26 @@ | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
var BASE_DIR = process.cwd(); | ||
var COMPONENT_FILE = process.env.COMPONENT_FILE; | ||
var COMPONENT_NAME = process.env.COMPONENT_NAME; | ||
var plugins = []; | ||
|
||
if (process.env.MINIFY) { | ||
plugins.push( | ||
new webpack.optimize.UglifyJsPlugin() | ||
); | ||
COMPONENT_FILE += '.min'; | ||
} | ||
|
||
module.exports = { | ||
entry: path.resolve(BASE_DIR, 'lib/main.js'), | ||
output: { | ||
filename: path.resolve(BASE_DIR, 'dist/' + COMPONENT_FILE + '.js'), | ||
library: COMPONENT_NAME, | ||
libraryTarget: 'umd' | ||
}, | ||
externals: { | ||
'react': 'React' | ||
}, | ||
plugins: plugins | ||
}; |
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