markdown Good-Practices-In-Js.md

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Good-Practices-In-Js.md相关的知识,希望对你有一定的参考价值。

# Overidding Path with WebPack Alias
* In webpack Config 
  * Go to alias object
  * Key it with any alias like aapp name 
  * value it with where path should begin 
  ```js
   alias: {
      
      // Support React Native Web
      // https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
      'react-native': 'react-native-web',
      'ps-react': path.resolve(__dirname, '../src/components/')
    },
  ```
  * Usage 
  ```js 
  import HelloWorld from '../../../components/HelloWorld/HelloWorld';
   
   // becomes 
   import HelloWorld from 'ps-react/HelloWorld/HelloWorld';
  ```
  
  # Avoid repetition of file names
  * create index.js file in the root of the component that exports the componet 
  ```js 
  export {default} from './HelloWorld'
  ```
  ```js
   import HelloWorld from 'ps-react/HelloWorld/HelloWorld';
   //becomes 
    import HelloWorld from 'ps-react/HelloWorld';
  ```
  ```

以上是关于markdown Good-Practices-In-Js.md的主要内容,如果未能解决你的问题,请参考以下文章

转换rst到markdown总结

markdown [Markdown HowTo]作为Markdown语法的秘籍

python markdown干啥用的

markdown前端渲染

如何用markdown生成目录

markdown排版示例