Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
fix: 修正 jsx 解析错误
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Oct 14, 2019
1 parent e27547e commit 4b71e7c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/remax-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@babel/types": "^7.4.4",
"@remax/postcss-px2units": "^0.2.0",
"@remax/rollup-plugin-postcss": "^2.0.4",
"acorn-jsx": "^5.1.0",
"acorn-walk": "^7.0.0",
"babel-preset-remax": "^1.2.0-beta.0",
"chokidar": "^2.1.8",
Expand Down
2 changes: 2 additions & 0 deletions packages/remax-cli/src/build/rollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import nativeComponentsBabelPlugin from './plugins/nativeComponents/babelPlugin'
import alias from './plugins/alias';
import extensions from '../extensions';
import { without } from 'lodash';
import jsx from 'acorn-jsx';

export default function rollupConfig(
options: RemaxOptions,
Expand Down Expand Up @@ -235,6 +236,7 @@ export default function rollupConfig(
},
preserveModules: true,
preserveSymlinks: true,
acornInjectPlugins: [jsx()],
/* istanbul ignore next */
onwarn(warning, warn) {
if ((warning as RollupWarning).code === 'THIS_IS_UNDEFINED') return;
Expand Down
1 change: 1 addition & 0 deletions packages/remax-cli/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ declare module 'slash2';
declare module 'named-exports-db';
declare module 'esm';
declare module 'sander';
declare module 'acorn-jsx';

declare namespace jest {
interface Matchers<R> {
Expand Down

1 comment on commit 4b71e7c

@vercel
Copy link

@vercel vercel bot commented on 4b71e7c Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.