fex-team / fis3-postpackager-loader

静态资源前端加载器
BSD 2-Clause "Simplified" License
82 stars 38 forks source link

mod 生成的resourceMap里的deps里有后缀jsx, es6 #16

Closed hanai closed 9 years ago

hanai commented 9 years ago

采用c hook-commonjs + postpacikager-load mod 方案。

fis.hook('commonjs', {
    paths: {
        jquery: '/deps/jquery/jquery',
        antd: '/deps/antd/antd-0.8.1-beta1.min',
        immutable: '/deps/immutable/immutable.min'
    },
    baseUrl: '/modules'
});

fis.match('::package', {
    postpackager: fis.plugin('loader', {
        resourceType: 'mod',
        useInlineMap: false,
        obtainScript: false,
        obtainStyle: false
    })
});

生成的resourceMap url部分正确

    "modules/component/sidebar/sidebar": {
      "url": "/static/modules/component/sidebar/sidebar.js",
      "type": "js",
      "deps": [
        "deps/react/react.js",
        "modules/common/user-info.js"
      ]
    },

在deps里的链接就错了

    "deps": [
        "deps/react/react.js",
        "deps/antd/antd-0.8.1-beta1.min.js",
        "modules/component/header/header.jsx",
        "modules/component/sidebar/sidebar.jsx"
      ]

导致请求 .es6 , .jsx 这些不存在的文件.