|
1 | 1 | import { visualizer } from 'rollup-plugin-visualizer' |
2 | 2 | import commonjs from '@rollup/plugin-commonjs' |
3 | | -import alias from '@rollup/plugin-alias' |
4 | 3 | import { nodeResolve } from '@rollup/plugin-node-resolve' |
5 | 4 | import eslint from '@rollup/plugin-eslint' |
6 | | -import { babel } from '@rollup/plugin-babel' |
7 | 5 | import cleanup from 'js-cleanup' |
8 | 6 | import * as rollup from 'rollup' |
9 | 7 | import * as recast from 'recast' |
10 | 8 | import recastBabylonParser from 'recast/parsers/babylon.js' |
11 | 9 | import nodePolyfills from 'rollup-plugin-polyfill-node' |
| 10 | +import typescript from '@rollup/plugin-typescript' |
12 | 11 | import path, { dirname } from 'path' |
13 | 12 | import { fileURLToPath } from 'url' |
14 | 13 | import pkg from './package.json' assert { type: 'json' } |
@@ -60,9 +59,12 @@ export default rollup.defineConfig({ |
60 | 59 | dir: 'dist', |
61 | 60 | format: 'esm', |
62 | 61 | preserveModules: true, |
63 | | - preserveModulesRoot: '/src' |
| 62 | + preserveModulesRoot: 'src' |
64 | 63 | }], |
65 | 64 | plugins: [ |
| 65 | + typescript({ |
| 66 | + noEmitOnError: true |
| 67 | + }), |
66 | 68 | nodePolyfills(), |
67 | 69 | eslint({ |
68 | 70 | throwOnError: true, |
@@ -93,31 +95,7 @@ export default rollup.defineConfig({ |
93 | 95 | return false |
94 | 96 | } |
95 | 97 | }), |
96 | | - babel({ |
97 | | - extensions, |
98 | | - presets: [ |
99 | | - ['@babel/preset-env', { |
100 | | - modules: false |
101 | | - }], |
102 | | - '@babel/preset-typescript' |
103 | | - ], |
104 | | - plugins: [ |
105 | | - '@babel/plugin-proposal-class-properties', |
106 | | - '@babel/plugin-proposal-optional-chaining' |
107 | | - ], |
108 | | - babelHelpers: 'bundled', |
109 | | - exclude: /node_modules\/(?!vscode-languageserver-types|vscode-languageclient)/ |
110 | | - }), |
111 | 98 | visualizer(), |
112 | | - alias({ |
113 | | - entries: [{ |
114 | | - find: /^monaco-editor-core\//, |
115 | | - replacement: 'monaco-editor/esm/vs/editor/editor.api' |
116 | | - }, { |
117 | | - find: /^(monaco-editor|monaco-editor-core)$/, |
118 | | - replacement: 'monaco-editor/esm/vs/editor/editor.api' |
119 | | - }] |
120 | | - }), |
121 | 99 | { |
122 | 100 | name: 'dynamic-import-polyfill', |
123 | 101 | renderDynamicImport (): { left: string, right: string } { |
|
0 commit comments