mirror of
https://github.com/jakejarvis/simple-anchor.git
synced 2025-04-26 05:15: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": [
|
"extends": [
|
||||||
"@jakejarvis/eslint-config"
|
"@jakejarvis/eslint-config",
|
||||||
|
"plugin:compat/recommended",
|
||||||
|
"plugin:import/recommended"
|
||||||
],
|
],
|
||||||
|
"parser": "@babel/eslint-parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 2015,
|
"requireConfigFile": false
|
||||||
"sourceType": "module"
|
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
@ -12,7 +14,6 @@
|
|||||||
},
|
},
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"*.d.ts",
|
"*.d.ts",
|
||||||
"dist/**",
|
"dist/**"
|
||||||
"rollup.config.js"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
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",
|
"name": "simple-anchor",
|
||||||
"version": "1.0.3",
|
"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)",
|
"author": "Jake Jarvis (https://github.com/jakejarvis)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
"Bryan Braun (https://github.com/bryanbraun)"
|
"Bryan Braun (https://github.com/bryanbraun)"
|
||||||
],
|
],
|
||||||
"description": "A bare-bones fork of AnchorJS.",
|
|
||||||
"license": "MIT",
|
|
||||||
"homepage": "https://github.com/jakejarvis/simple-anchor",
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/jakejarvis/simple-anchor.git"
|
"url": "https://github.com/jakejarvis/simple-anchor.git"
|
||||||
@ -27,24 +27,29 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
|
"watch": "rollup -c -w",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"prepublishOnly": "yarn build"
|
"prepublishOnly": "yarn build"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.15.0",
|
"@babel/core": "^7.15.8",
|
||||||
"@babel/preset-env": "^7.15.0",
|
"@babel/eslint-parser": "^7.15.8",
|
||||||
|
"@babel/preset-env": "^7.15.8",
|
||||||
"@jakejarvis/eslint-config": "*",
|
"@jakejarvis/eslint-config": "*",
|
||||||
"@rollup/plugin-babel": "^5.3.0",
|
"@rollup/plugin-babel": "^5.3.0",
|
||||||
|
"@rollup/plugin-commonjs": "^21.0.0",
|
||||||
"@rollup/plugin-eslint": "^8.0.1",
|
"@rollup/plugin-eslint": "^8.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^13.0.4",
|
"@rollup/plugin-node-resolve": "^13.0.5",
|
||||||
"eslint": "^7.32.0",
|
"builtin-modules": "^3.2.0",
|
||||||
|
"eslint": "^8.0.0",
|
||||||
"eslint-plugin-compat": "^3.13.0",
|
"eslint-plugin-compat": "^3.13.0",
|
||||||
"eslint-plugin-import": "^2.24.2",
|
"eslint-plugin-import": "^2.25.2",
|
||||||
"rollup": "^2.56.3",
|
"rollup": "^2.58.0",
|
||||||
"rollup-plugin-copy": "^3.4.0",
|
"rollup-plugin-copy": "^3.4.0",
|
||||||
"rollup-plugin-delete": "^2.0.0",
|
"rollup-plugin-delete": "^2.0.0",
|
||||||
"rollup-plugin-filesize": "^9.1.1",
|
"rollup-plugin-filesize": "^9.1.1",
|
||||||
|
"rollup-plugin-node-externals": "^2.2.0",
|
||||||
"rollup-plugin-terser": "^7.0.2"
|
"rollup-plugin-terser": "^7.0.2"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -1,30 +1,34 @@
|
|||||||
import pkg from "./package.json";
|
import pkg from "./package.json";
|
||||||
import resolve from "@rollup/plugin-node-resolve";
|
import resolve from "@rollup/plugin-node-resolve";
|
||||||
|
import externals from "rollup-plugin-node-externals";
|
||||||
import { babel } from "@rollup/plugin-babel";
|
import { babel } from "@rollup/plugin-babel";
|
||||||
import { terser } from "rollup-plugin-terser";
|
import { terser } from "rollup-plugin-terser";
|
||||||
import eslint from "@rollup/plugin-eslint";
|
|
||||||
import filesize from "rollup-plugin-filesize";
|
import filesize from "rollup-plugin-filesize";
|
||||||
import copy from "rollup-plugin-copy";
|
import copy from "rollup-plugin-copy";
|
||||||
import del from "rollup-plugin-delete";
|
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 [
|
export default [
|
||||||
{
|
{
|
||||||
// universal (browser and node)
|
// universal (browser and node)
|
||||||
input: "src/index.js",
|
input,
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
name: "SimpleAnchor",
|
name: exportName,
|
||||||
file: "dist/simple-anchor.js",
|
file: pkg.exports.browser.replace(".min.js", ".js"), // unminified (.js)
|
||||||
format: "umd",
|
format: "umd",
|
||||||
exports: "named",
|
exports: "named",
|
||||||
esModule: false,
|
esModule: false,
|
||||||
banner: banner,
|
banner: banner,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "SimpleAnchor",
|
name: exportName,
|
||||||
file: "dist/simple-anchor.min.js",
|
file: pkg.exports.browser, // minified (.min.js)
|
||||||
format: "umd",
|
format: "umd",
|
||||||
exports: "named",
|
exports: "named",
|
||||||
esModule: false,
|
esModule: false,
|
||||||
@ -44,13 +48,14 @@ export default [
|
|||||||
// clearly this isn't really typescript, so we need to manually copy the type definition file
|
// clearly this isn't really typescript, so we need to manually copy the type definition file
|
||||||
targets: [
|
targets: [
|
||||||
{
|
{
|
||||||
src: "src/index.d.ts",
|
src: input.replace(".js", ".d.ts"),
|
||||||
dest: "dist",
|
dest: "dist",
|
||||||
rename: "simple-anchor.d.ts",
|
rename: pkg.types.replace("./dist/", ""),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
resolve(),
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
eslint(),
|
eslint(),
|
||||||
babel({
|
babel({
|
||||||
babelHelpers: "bundled",
|
babelHelpers: "bundled",
|
||||||
@ -62,24 +67,25 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// modules
|
// modules
|
||||||
input: "src/index.js",
|
input,
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
// ES6 module (import)
|
// ES6 module (import)
|
||||||
file: "dist/simple-anchor.esm.js",
|
file: pkg.exports.import,
|
||||||
format: "esm",
|
format: "esm",
|
||||||
exports: "named",
|
exports: "named",
|
||||||
banner: banner,
|
banner: banner,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// commonjs (require)
|
// commonjs (require)
|
||||||
file: "dist/simple-anchor.cjs.js",
|
file: pkg.exports.require,
|
||||||
format: "cjs",
|
format: "cjs",
|
||||||
exports: "named",
|
exports: "named",
|
||||||
banner: banner,
|
banner: banner,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
|
externals({ deps: true }),
|
||||||
resolve(),
|
resolve(),
|
||||||
babel({
|
babel({
|
||||||
babelHelpers: "bundled",
|
babelHelpers: "bundled",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user