Norman's Note 諾曼筆記

Norman's Note 諾曼筆記

Babel

re-export

import * as React from 'react';

export default React;
export * from 'react';

export { default } from 'react';

import React from './reExport';

檔案路徑用 @ 來替代 ./ 的方法,增加引入的一致性

  "plugins": [
    [
      "babel-plugin-module-resolver",
      {
        "alias": {
          "@": "./"
        }
      }
    ]
  ]