Skip to content

Replace webpack with rollup #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .babelrc

This file was deleted.

8 changes: 8 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
"presets": ["@babel/env"],
"env": {
"esm": {
"presets": [["@babel/env", { "modules": false }]]
}
}
};
7 changes: 7 additions & 0 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"dist/gl-matrix-min.js": {
"bundled": 193205,
"minified": 48824,
"gzipped": 11861
}
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ node_js:
- "8.0.0"
script:
- npm run build
- mocha --compilers js:babel-register --recursive spec
- npm run test
2 changes: 1 addition & 1 deletion dist/gl-matrix-min.js

Large diffs are not rendered by default.

7,427 changes: 7,426 additions & 1 deletion dist/gl-matrix.js

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,28 @@
}
],
"scripts": {
"test": "mocha --require babel-register --recursive spec",
"test": "mocha --require @babel/register --recursive spec",
"old_test": "jasmine-node spec",
"doc": "jsdoc -c jsdoc.config.json",
"update-license-version": "node utils/update-license-version.js",
"build-umd": "webpack --config utils/webpack.config.js",
"build-min": "webpack --config utils/webpack.config.min.js",
"build-umd": "rollup -c",
"build-esm": "BABEL_ENV=esm babel src -d dist/esm",
"build-cjs": "BABEL_ENV=production babel src -d dist/cjs",
"build": "del dist && npm run update-license-version && npm run build-umd && npm run build-min && npm run build-esm && npm run build-cjs && node ./utils/build.js"
"build-cjs": "babel src -d dist/cjs",
"build": "del dist && npm run update-license-version && npm run build-umd && npm run build-esm && npm run build-cjs && node ./utils/build.js"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@babel/register": "^7.0.0",
"del-cli": "^1.1.0",
"jsdoc": "^3.5.5",
"mocha": "^5.1.1",
"node-libs-browser": "^2.1.0",
"uglifyjs-webpack-plugin": "^1.2.5",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.1"
"rollup": "^0.67.3",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-size-snapshot": "^0.7.0",
"rollup-plugin-terser": "^3.0.0"
},
"dependencies": {}
}
44 changes: 44 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';

const version = require('./package.json').version;
const license = require('./utils/license-template');

const input = './src/index.js';
const name = 'glMatrix';

const bannerPlugin = {
banner: `/*!
@fileoverview gl-matrix - High performance matrix and vector operations
@author Brandon Jones
@author Colin MacKenzie IV
@version ${version}

${license}

*/`
}

export default [
{
input,
output: { file: 'dist/gl-matrix.js', format: 'umd', name },
plugins: [
bannerPlugin,
babel()
]
},
{
input,
output: { file: 'dist/gl-matrix-min.js', format: 'umd', name },
plugins: [
bannerPlugin,
babel(),
sizeSnapshot(),
terser({
output: { comments: /^!/ }
})
]
}
];
40 changes: 0 additions & 40 deletions utils/webpack.config.js

This file was deleted.

15 changes: 0 additions & 15 deletions utils/webpack.config.min.js

This file was deleted.

Loading