ghostgril

webpack, node, es6 的 require 和 import 如何区分

  •  
  •   ghostgril · May 4, 2018 · 1742 views
    This topic created in 2931 days ago, the information mentioned may be changed or developed.

    在 webpack,node 和 es6 三者的环境下开发,完全搞不懂这些关系了。node 有 require 方法,webpack 也有 require 和 require.context,搞不清这几种模块方法的区别,再加上使用 vue 的 import 方法

    3 replies    2018-05-04 20:59:56 +08:00
    ghostgril
        1
    ghostgril  
    OP
       May 4, 2018
    晕了
    ghostgril
        2
    ghostgril  
    OP
       May 4, 2018
    在 vue 文档里看到这个

    require(['./my-async-component'], resolve)

    这个是上面语法?
    SuperMild
        3
    SuperMild  
       May 4, 2018
    typescript 教程里 Code Generation for Modules 那部分,有各种 import require 的对比。

    http://www.typescriptlang.org/docs/handbook/modules.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5546 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 68ms · UTC 08:38 · PVG 16:38 · LAX 01:38 · JFK 04:38
    ♥ Do have faith in what you're doing.