forked from noahlam/Miment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. specific
main
field in package.json
, and replace files
field…
… with `dist/miment.min.js` 2. replace webpack with rollup to reduce pkg size (3.16kb -> 2.86kb), and simplify the workflow 3. the script should be `dist` in `example.html` rather than source code.
- Loading branch information
Showing
7 changed files
with
198 additions
and
1,306 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 +1 @@ | ||
{"presets": ["env"]} | ||
{"presets": [["env", {"modules": false}]]} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -3,16 +3,17 @@ | |
"version": "0.0.5", | ||
"description": "a fast,light weight,simple and non-dependencies datetime library for javascript ( mini moment )", | ||
"files": [ | ||
"./src/miment.js" | ||
"dist/miment-min.js" | ||
], | ||
"main": "dist/miment-min.js", | ||
"repository": { | ||
"url": "https://github.com/noahlam/Miment.git", | ||
"type": "git" | ||
}, | ||
"author": "noahlam <[email protected]>", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "webpack --config ./webpack.config.js", | ||
"build": "rollup -c", | ||
"test": "ava" | ||
}, | ||
"dependencies": {}, | ||
|
@@ -26,6 +27,11 @@ | |
"babel-core": "*", | ||
"babel-loader": "^6.0.0", | ||
"babel-preset-env": "^1.3.2", | ||
"webpack": "2.2.0" | ||
"rollup": "^0.58.0", | ||
"rollup-plugin-babel": "^3.0.3", | ||
"rollup-plugin-commonjs": "^9.1.0", | ||
"rollup-plugin-filesize": "^1.5.0", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-uglify": "^3.0.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import babel from 'rollup-plugin-babel'; | ||
import cjs from 'rollup-plugin-commonjs'; | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
import uglify from 'rollup-plugin-uglify'; | ||
import filesize from 'rollup-plugin-filesize'; | ||
|
||
export default { | ||
input: 'src/miment.js', | ||
output: { | ||
file: 'dist/miment-min.js', | ||
name: 'miment', | ||
format: 'umd' | ||
}, | ||
plugins: [ | ||
babel({ | ||
exclude: 'node_modules/**' | ||
}), | ||
resolve({ | ||
jsnext: true, | ||
main: true, | ||
browser: true | ||
}), | ||
cjs(), | ||
filesize(), | ||
uglify() | ||
] | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.