mirror of
https://github.com/jakejarvis/simple-anchor.git
synced 2025-04-26 01:45:22 -04:00
bring bundle config up-to-date with rollup template
https://github.com/jakejarvis/rollup-module-template
This commit is contained in:
parent
0d5fc809c7
commit
ded4f88b2e
17
.editorconfig
Normal file
17
.editorconfig
Normal file
@ -0,0 +1,17 @@
|
||||
# http://editorconfig.org
|
||||
|
||||
# this file is the top-most editorconfig file
|
||||
root = true
|
||||
|
||||
# all files
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
# site content
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
@ -1,10 +1,12 @@
|
||||
{
|
||||
"extends": [
|
||||
"@jakejarvis/eslint-config"
|
||||
"@jakejarvis/eslint-config",
|
||||
"plugin:compat/recommended",
|
||||
"plugin:import/recommended"
|
||||
],
|
||||
"parser": "@babel/eslint-parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2015,
|
||||
"sourceType": "module"
|
||||
"requireConfigFile": false
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
@ -12,7 +14,6 @@
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"*.d.ts",
|
||||
"dist/**",
|
||||
"rollup.config.js"
|
||||
"dist/**"
|
||||
]
|
||||
}
|
||||
|
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
* text=auto eol=lf
|
23
package.json
23
package.json
@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "simple-anchor",
|
||||
"version": "1.0.3",
|
||||
"description": "A bare-bones fork of AnchorJS.",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/jakejarvis/simple-anchor",
|
||||
"author": "Jake Jarvis (https://github.com/jakejarvis)",
|
||||
"contributors": [
|
||||
"Bryan Braun (https://github.com/bryanbraun)"
|
||||
],
|
||||
"description": "A bare-bones fork of AnchorJS.",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/jakejarvis/simple-anchor",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jakejarvis/simple-anchor.git"
|
||||
@ -27,24 +27,29 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"watch": "rollup -c -w",
|
||||
"lint": "eslint .",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.0",
|
||||
"@babel/preset-env": "^7.15.0",
|
||||
"@babel/core": "^7.15.8",
|
||||
"@babel/eslint-parser": "^7.15.8",
|
||||
"@babel/preset-env": "^7.15.8",
|
||||
"@jakejarvis/eslint-config": "*",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-commonjs": "^21.0.0",
|
||||
"@rollup/plugin-eslint": "^8.0.1",
|
||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
||||
"eslint": "^7.32.0",
|
||||
"@rollup/plugin-node-resolve": "^13.0.5",
|
||||
"builtin-modules": "^3.2.0",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-plugin-compat": "^3.13.0",
|
||||
"eslint-plugin-import": "^2.24.2",
|
||||
"rollup": "^2.56.3",
|
||||
"eslint-plugin-import": "^2.25.2",
|
||||
"rollup": "^2.58.0",
|
||||
"rollup-plugin-copy": "^3.4.0",
|
||||
"rollup-plugin-delete": "^2.0.0",
|
||||
"rollup-plugin-filesize": "^9.1.1",
|
||||
"rollup-plugin-node-externals": "^2.2.0",
|
||||
"rollup-plugin-terser": "^7.0.2"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -1,30 +1,34 @@
|
||||
import pkg from "./package.json";
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
import externals from "rollup-plugin-node-externals";
|
||||
import { babel } from "@rollup/plugin-babel";
|
||||
import { terser } from "rollup-plugin-terser";
|
||||
import eslint from "@rollup/plugin-eslint";
|
||||
import filesize from "rollup-plugin-filesize";
|
||||
import copy from "rollup-plugin-copy";
|
||||
import del from "rollup-plugin-delete";
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import eslint from "@rollup/plugin-eslint";
|
||||
|
||||
const banner = `/*! Simple Anchor v${pkg.version} | MIT License | https://github.com/jakejarvis/simple-anchor */`;
|
||||
const exportName = "SimpleAnchor";
|
||||
const input = "src/index.js";
|
||||
const banner = `/*! ${pkg.name} v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */`;
|
||||
|
||||
export default [
|
||||
{
|
||||
// universal (browser and node)
|
||||
input: "src/index.js",
|
||||
input,
|
||||
output: [
|
||||
{
|
||||
name: "SimpleAnchor",
|
||||
file: "dist/simple-anchor.js",
|
||||
name: exportName,
|
||||
file: pkg.exports.browser.replace(".min.js", ".js"), // unminified (.js)
|
||||
format: "umd",
|
||||
exports: "named",
|
||||
esModule: false,
|
||||
banner: banner,
|
||||
},
|
||||
{
|
||||
name: "SimpleAnchor",
|
||||
file: "dist/simple-anchor.min.js",
|
||||
name: exportName,
|
||||
file: pkg.exports.browser, // minified (.min.js)
|
||||
format: "umd",
|
||||
exports: "named",
|
||||
esModule: false,
|
||||
@ -44,13 +48,14 @@ export default [
|
||||
// clearly this isn't really typescript, so we need to manually copy the type definition file
|
||||
targets: [
|
||||
{
|
||||
src: "src/index.d.ts",
|
||||
src: input.replace(".js", ".d.ts"),
|
||||
dest: "dist",
|
||||
rename: "simple-anchor.d.ts",
|
||||
rename: pkg.types.replace("./dist/", ""),
|
||||
},
|
||||
],
|
||||
}),
|
||||
resolve(),
|
||||
commonjs(),
|
||||
eslint(),
|
||||
babel({
|
||||
babelHelpers: "bundled",
|
||||
@ -62,24 +67,25 @@ export default [
|
||||
},
|
||||
{
|
||||
// modules
|
||||
input: "src/index.js",
|
||||
input,
|
||||
output: [
|
||||
{
|
||||
// ES6 module (import)
|
||||
file: "dist/simple-anchor.esm.js",
|
||||
file: pkg.exports.import,
|
||||
format: "esm",
|
||||
exports: "named",
|
||||
banner: banner,
|
||||
},
|
||||
{
|
||||
// commonjs (require)
|
||||
file: "dist/simple-anchor.cjs.js",
|
||||
file: pkg.exports.require,
|
||||
format: "cjs",
|
||||
exports: "named",
|
||||
banner: banner,
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
externals({ deps: true }),
|
||||
resolve(),
|
||||
babel({
|
||||
babelHelpers: "bundled",
|
||||
|
Loading…
x
Reference in New Issue
Block a user