Skip to content

Commit

Permalink
Simplify rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner committed Apr 1, 2024
1 parent 3e82368 commit a21b1fd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion shepherd.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"autoprefixer": "^10.4.19",
"cssnano": "^6.1.2",
"del": "^7.1.0",
"glob": "^10.3.10",
"jsdoc": "^4.0.2",
"jsdoc-template-ship-shape": "^0.1.1",
"postcss": "^8.4.38",
Expand Down
21 changes: 2 additions & 19 deletions shepherd.js/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import autoprefixer from 'autoprefixer';
import fs from 'fs';
import path from 'node:path';
import { globSync } from 'glob';
import { fileURLToPath } from 'node:url';
import cssnanoPlugin from 'cssnano';
import { babel } from '@rollup/plugin-babel';
import serve from 'rollup-plugin-serve';
Expand All @@ -28,7 +25,7 @@ const plugins = [
emitCss: true
}),
nodeResolve({
extensions: ['.js', '.json', '.svelte', '.ts'],
extensions: ['.js', '.json', '.mjs', '.svelte', '.ts'],
modulesOnly: true
}),
typescript(),
Expand Down Expand Up @@ -57,23 +54,9 @@ if (process.env.DEVELOPMENT) {
plugins.push(livereload());
}

const inputFiles = Object.fromEntries(
globSync('src/**/*.ts').map((file) => [
// This remove `src/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
path.relative(
'src',
file.slice(0, file.length - path.extname(file).length)
),
// This expands the relative paths to absolute paths, so e.g.
// src/nested/foo becomes /project/src/nested/foo.js
fileURLToPath(new URL(file, import.meta.url))
])
);

export default [
{
input: inputFiles,
input: 'src/shepherd.ts',

output: [
{
Expand Down

0 comments on commit a21b1fd

Please sign in to comment.