This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webpack build for browser step added | build for npm step added (#9)
* webpack build for browser step added | build for npm step added * package * added babel-plugin module to package for travis
- Loading branch information
1 parent
8f17145
commit 4e3fc97
Showing
11 changed files
with
87 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} | ||
"presets": ["es2015"], | ||
"plugins": ["babel-plugin-add-module-exports"] | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,32 +1,34 @@ | ||
{ | ||
"name": "@cosmocochrane/giphy-web-sdk-core", | ||
"version": "1.0.14", | ||
"version": "1.0.16", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "npm run compile && mocha --compilers js:babel-core/register", | ||
"compile": "babel -d lib/ src/", | ||
"lint": "gulp default" | ||
"test": "babel -d lib/ src/ && mocha --compilers js:babel-core/register", | ||
"lint": "gulp default", | ||
"build_for_npm": "gulp; babel -d lib/ src/", | ||
"build_for_browser": "WEBPACK_ENV=build webpack" | ||
}, | ||
"author": "", | ||
"author": "Cosmo Cochrane", | ||
"license": "ISC", | ||
"dependencies": { | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"es6-promise": "^4.1.0", | ||
"isomorphic-fetch": "^2.2.1", | ||
"lodash": "^4.17.4", | ||
"promise": "^7.1.1" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"gulp": "^3.9.1", | ||
"chai": "^3.5.0", | ||
"gulp-eslint": "^3.0.1", | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^7.2.3", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"mocha": "^3.3.0", | ||
"babel-core": "^6.24.1", | ||
"gulp-jsbeautifier": "^2.1.0" | ||
"chai": "^3.5.0", | ||
"gulp": "^3.9.1", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-jsbeautifier": "^2.1.0", | ||
"mocha": "^3.3.0" | ||
} | ||
} |
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,54 @@ | ||
// webpack.config.js | ||
|
||
var webpack = require('webpack'); | ||
var path = require('path'); | ||
var libraryName = 'library'; | ||
var outputFile = libraryName + '.js'; | ||
|
||
var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; | ||
var env = process.env.WEBPACK_ENV; | ||
|
||
var libraryName = 'GphApiClient'; | ||
var plugins = []; | ||
var outputFile; | ||
|
||
if (env === 'build') { | ||
plugins.push(new UglifyJsPlugin({ minimize: true })); | ||
outputFile = libraryName + '.min.js'; | ||
} else { | ||
outputFile = libraryName + '.js'; | ||
} | ||
|
||
module.exports = { | ||
entry: __dirname + '/src/GphApiClient.js', | ||
devtool: 'source-map', | ||
output: { | ||
path: __dirname + '/build_for_browser', | ||
filename: outputFile, | ||
library: libraryName, | ||
libraryTarget: 'umd', | ||
umdNamedDefine: true | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /(\.jsx|\.js)$/, | ||
loader: 'babel-loader', | ||
exclude: /(node_modules|bower_components)/ | ||
}, | ||
{ | ||
test: /(\.jsx|\.js)$/, | ||
loader: "eslint-loader", | ||
exclude: /node_modules/ | ||
} | ||
] | ||
}, | ||
plugins: plugins, | ||
resolve: { | ||
modules: [ | ||
path.join(__dirname, "src"), | ||
"node_modules" | ||
] | ||
} | ||
}; | ||
|