Skip to content

Commit

Permalink
Update build process
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdiamant committed Feb 25, 2019
1 parent fab8f1a commit 7e85da4
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 53 deletions.
19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "magnify-3d",
"version": "1.0.0",
"version": "1.0.1",
"description": "Real time optic magnifying glass library.",
"main": "build/Magnify3d.js",
"scripts": {
"dev": "./node_modules/.bin/webpack-dev-server --config ./webpack.config.sample --devtool source-map --progress --hot --mode=development",
"build": "NODE_ENV=production webpack --progress --config ./webpack.config.build --mode=production",
"build": "rm -rf ./build && cross-env NODE_ENV=rollup rollup -c",
"build-sample": "NODE_ENV=production webpack --progress --config ./webpack.config.sample --mode=production",
"deploy-sample": "gh-pages -d build/sample"
"deploy-sample": "npm run build-sample && gh-pages -d build/sample"
},
"author": "Amit Diamant",
"repository": {
Expand All @@ -16,17 +16,28 @@
},
"license": "MIT",
"devDependencies": {
"babel-cli": "6.23.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"clean-webpack-plugin": "^1.0.1",
"copy-webpack-plugin": "^5.0.0",
"cross-env": "2.0.1",
"dat.gui": "^0.7.5",
"gh-pages": "^2.0.1",
"html-webpack-plugin": "^3.2.0",
"npm-run-all": "4.0.1",
"rollup": "^0.57.1",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-glsl": "^1.3.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0",
"webpack": "4.29.3",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.1.14",
"webpack-glsl-loader": "1.0.1"
"webpack-glsl-loader": "1.0.1",
"three": "^0.92.0"
},
"peerDependencies": {
"three": "^0.92.0"
Expand Down
41 changes: 41 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import replace from 'rollup-plugin-replace';
import uglify from 'rollup-plugin-uglify';
import glsl from 'rollup-plugin-glsl';

export default {
input: './src/Magnify3d.js',
output: {
file: 'build/Magnify3d.js',
format: 'umd',
name: 'Magnify3d',
globals: {
three: 'THREE',
},
},
external: ['three'],
plugins: [
nodeResolve(),
commonjs({
include: 'node_modules/**',
}),
glsl({
include: 'src/shaders/*.glsl'
}),
babel({
exclude: 'node_modules/**',
}),
replace({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
uglify({
mangle: false,
output: {
comments: false,
beautify: false,
},
}),
],
};
49 changes: 0 additions & 49 deletions webpack.config.build.js

This file was deleted.

0 comments on commit 7e85da4

Please sign in to comment.