Skip to content

Commit

Permalink
fix: keep references inside declaration
Browse files Browse the repository at this point in the history
Closes #159
  • Loading branch information
Anidetrix committed Dec 30, 2020
1 parent df78c78 commit a6f9b35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
13 changes: 12 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint node/no-unsupported-features/es-syntax: ["error", { ignores: ["modules"] }] */
import { readdirSync } from "fs-extra";

import { terser } from "rollup-plugin-terser";
import babel from "@rollup/plugin-babel";
Expand Down Expand Up @@ -52,6 +53,16 @@ export default [
{
input: "src/index.ts",
output: { format: "es", file: pkg.types },
plugins: [externals({ deps: true }), dts({ respectExternal: true })],
plugins: [
externals({ deps: true }),
dts({ respectExternal: true }),
{
name: "shims",
banner: readdirSync(`${__dirname}/src/shims`)
.map(s => s.replace(/\.ts$/, "").replace(/\.d$/, ""))
.map(s => `/// <reference types="./shims/${s}" />`)
.join("\n"),
},
],
},
];
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/// <reference types="./shims/icss-utils" />
/// <reference types="./shims/postcss-modules" />
/// <reference types="./shims/fibers" />
/// <reference types="./shims/sass" />
/// <reference types="./shims/less" />
/// <reference types="./shims/stylus" />

import path from "path";
import { Plugin, OutputChunk, OutputAsset } from "rollup";
import { createFilter } from "@rollup/pluginutils";
Expand Down

0 comments on commit a6f9b35

Please sign in to comment.