Skip to content

Commit

Permalink
replace parcel with rollup..
Browse files Browse the repository at this point in the history
  • Loading branch information
Recidvst committed Oct 16, 2023
1 parent d4eee8c commit 52ee923
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current",
"browsers": [
"last 5 versions",
"not ie <= 8"
]
},
"modules": false
}
]
],
"plugins": [
"add-module-exports"
],
"env": {
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current",
"browsers": [
"last 5 versions",
"not ie <= 8"
]
}
}
]
],
"plugins": [
"add-module-exports"
]
}
}
}
28 changes: 28 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "eslint:recommended",
"env": {
"browser": true,
"node": true,
"es6": true
},
"globals": {
"window": true,
"ga": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2017
},
"rules": {
"no-console": ["off"],
"no-tabs": ["off"],
"indent": ["off"],
"eol-last": "off",
"func-names": ["off"],
"max-len": "off",
"no-param-reassign": ["error", { "props": false }],
"no-shadow": ["error", { "hoist": "never" }],
"no-unused-vars": ["off"],
"import/prefer-default-export": ["off"]
}
}
44 changes: 44 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import { eslint } from 'rollup-plugin-eslint';
import uglify from 'rollup-plugin-uglify-es';

const dist = 'dist';

export default {
input: 'js/scrambler.js',
output: [
{
file: `${dist}/scrambler.cjs.js`,
format: 'cjs'
},
{
file: `${dist}/scrambler.esm.js`,
format: 'esm'
},
{
name: 'Scrambler',
file: `${dist}/scrambler.umd.js`,
format: 'umd'
},
{
name: 'Scrambler',
file: `${dist}/scrambler.iife.js`,
format: 'iife'
},
{
name: 'Scrambler',
file: `${dist}/scrambler.min.js`,
format: 'iife'
}
],
plugins: [
resolve(),
eslint(),
babel({
exclude: 'node_modules/**'
}),
uglify()
]
}

0 comments on commit 52ee923

Please sign in to comment.