-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added webpack build for node support
- Loading branch information
Showing
6 changed files
with
65 additions
and
19 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": ["transform-class-properties"] | ||
} |
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,4 @@ | ||
/node_modules/ | ||
/node_modules | ||
/dist | ||
yarn.lock | ||
package-lock.json |
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 |
---|---|---|
@@ -1,30 +1,40 @@ | ||
{ | ||
"name": "elao-container.js", | ||
"version": "1.0.0", | ||
"name": "@elao/container.js", | ||
"version": "2.0.0", | ||
"description": "Microscopic dependency injection container", | ||
"main": "src/Container.js", | ||
"keywords": [ | ||
"dependency", | ||
"injection", | ||
"container", | ||
"service" | ||
], | ||
"main": "dist/container.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Elao/container.js.git" | ||
}, | ||
"author": "Thomas Jarrand <[email protected]>", | ||
"author": "Thomas Jarrand <[email protected]> (http://thomas.jarrand.fr)", | ||
"license": "MIT", | ||
"copyright": "Copyright 2017 élao", | ||
"bugs": { | ||
"url": "https://github.com/Elao/container.js/issues" | ||
}, | ||
"homepage": "https://github.com/Elao/container.js#readme", | ||
"scripts": { | ||
"test": "jest" | ||
"test": "jest", | ||
"build": "NODE_ENV=production webpack", | ||
"start": "NODE_ENV=dev webpack --watch" | ||
}, | ||
"keywords": [ | ||
"dependency", | ||
"injection", | ||
"container", | ||
"service" | ||
], | ||
"devDependencies": { | ||
"babel-jest": "^19.0.0", | ||
"babel-preset-es2015": "^6.24.0", | ||
"jest": "^19.0.2" | ||
"babel": "^6.23.0", | ||
"babel-core": "^6.25.0", | ||
"babel-eslint": "^7.2.3", | ||
"babel-jest": "^20.0.3", | ||
"babel-loader": "^7.0.0", | ||
"babel-plugin-transform-class-properties": "^6.24.1", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"jest": "^20.0.4", | ||
"webpack": "^2.6.1" | ||
} | ||
} |
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,33 @@ | ||
const webpack = require('webpack'); | ||
const meta = require('./package.json'); | ||
|
||
module.exports = { | ||
entry: './src/Container.js', | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader' | ||
}, | ||
] | ||
}, | ||
output: { | ||
path: __dirname + '/dist', | ||
filename: 'container.js', | ||
library: 'Container', | ||
libraryTarget: 'umd', | ||
}, | ||
devServer: { | ||
contentBase: './dist', | ||
}, | ||
devtool: 'source-map', | ||
plugins: [ | ||
new webpack.optimize.UglifyJsPlugin(), | ||
new webpack.BannerPlugin([ | ||
`${meta.name} - ${meta.version}`, | ||
`${meta.homepage}`, | ||
`${meta.copyright}`, | ||
].join('\n')) | ||
] | ||
}; |