Skip to content

Commit

Permalink
Added build task and webpack config to compile as UMD library.
Browse files Browse the repository at this point in the history
Added pre-publish task.
  • Loading branch information
okonet committed Nov 12, 2015
1 parent 0e8a570 commit e636285
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
.idea
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
"name": "react-absolute-grid",
"version": "1.0.4",
"description": "An absolutely positioned responsive touch-enabled fully configurable React grid with drag/drop, filtering, and sorting",
"main": "demos/index.html",
"main": "dist/index.js",
"scripts": {
"build": "webpack --config webpack/build.config.js --optimize-minimize",
"build-demo": "webpack --config 'webpack/demo.config.js' --optimize-minimize --content-base demo",
"dev": "webpack-dev-server --config 'webpack/dev.config.js' --devtool eval --progress --colors --hot --content-base demo",
"lint": "eslint src"
"lint": "eslint lib",
"pre-publish": "npm run lint && npm run build"
},
"author": "Jonathan Rowny",
"license": "MIT",
"dependencies": {
"lodash.debounce": "^3.1.1",
"lodash.sortby": "^3.1.5"
},
"dependencies": {},
"peerDependencies": {
"react": "^0.14.0"
},
Expand All @@ -24,6 +23,8 @@
"eslint": "^0.21.2",
"eslint-plugin-react": "^2.4.0",
"lodash": "^3.10.1",
"lodash.debounce": "^3.1.1",
"lodash.sortby": "^3.1.5",
"node-libs-browser": "^0.5.2",
"react": "^0.14.0",
"react-dom": "^0.14.0",
Expand Down
20 changes: 20 additions & 0 deletions webpack/build.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
entry: './index.js',
output: {
path: './dist',
filename: 'index.js',
libraryTarget: 'umd',
library: 'AbsoluteGrid'
},
module: {
loaders: [{
test: /\.jsx?$/, // A regexp to test the require path. accepts either js or jsx
loader: 'babel' // The module to load. "babel" is short for "babel-loader"
}]
},
externals: {
react: 'React'
}
};


0 comments on commit e636285

Please sign in to comment.