Skip to content

Commit

Permalink
es6
Browse files Browse the repository at this point in the history
  • Loading branch information
kgolinski committed Jun 22, 2023
1 parent e1f9933 commit 900e7cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A collection of snippets for creative coding",
"main": "utils.js",
"scripts": {
"rollup": "rollup --config src/rollup.config.js",
"rollup": "rollup --config src/rollup.config.mjs",
"docs": "jsdoc2md --template src/README.hbs --files src/utils.js --separators --param-list-format list --property-list-format list --helper src/year.js> README.md",
"build": "npm run rollup && npm run docs",
"pretest": "npm run build",
Expand All @@ -15,8 +15,7 @@
"node": ">=16.0.0 <20.0.0"
},
"files": [
"utils.js",
"README.md"
"utils.js"
],
"banner": "'/*!*/'",
"homepage": "https://github.com/panGenerator/utils#readme",
Expand All @@ -33,6 +32,7 @@
},
"license": "MIT",
"devDependencies": {
"@rollup/plugin-terser": "^0.4.3",
"eslint": "^7.0.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
Expand All @@ -42,7 +42,6 @@
"eslint-plugin-standard": "^4.0.1",
"jsdoc-to-markdown": "^6.0.1",
"mocha": "^7.1.2",
"rollup": "^2.26.11",
"rollup-plugin-terser": "^7.0.2"
"rollup": "^3.25.1"
}
}
5 changes: 3 additions & 2 deletions src/banner.js → src/banner.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const pkg = require('../package.json')
//const pkg = require('../package.json')
import pkg from '../package.json' assert { type: 'json' };
const year = new Date().getFullYear()

module.exports = (pluginFilename) => {
export default (pluginFilename) => {
return `/*!
* @license ${pkg.name} v${pkg.version}, Copyright © ${year} ${pkg.author}
* Released under ${pkg.license} license
Expand Down
8 changes: 4 additions & 4 deletions src/rollup.config.js → src/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { terser } = require('rollup-plugin-terser')
const banner = require('./banner.js')
import terser from '@rollup/plugin-terser'
import banner from './banner.mjs'

module.exports = {
export default {
input: 'src/main.js',
output: {
banner,
Expand All @@ -10,4 +10,4 @@ module.exports = {
format: 'umd'
},
plugins: [terser()]
}
}
Loading

0 comments on commit 900e7cc

Please sign in to comment.