We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sourceMaps: true 配置没有产生 .map 文件 fis.match('{*.jsx,*:jsx}', { parser: fis.plugin('babel-6.x', { sourceMaps: true }), rExt: '.js' });
fis.match('{*.jsx,*:jsx}', { parser: fis.plugin('babel-6.x', { sourceMaps: true }), rExt: '.js' });
https://github.com/fex-team/fis3-demo/tree/master/use-react 换成 babel-6.x .map 文件产生
The text was updated successfully, but these errors were encountered:
需要修改下 fis-parser-babel-6.x
module.exports = function(content, file, conf) { // 添加 useBabel 配置项,如果 useBabel 为 false 则不进行编译 if (file.useBabel === false) { return content; } conf = fis.util.extend({ presets: [ preset2015, presetstage3, react ] }, conf); // 添加 jsx 的 html 语言能力处理 if (fis.compile.partial && file.ext === '.jsx') { content = fis.compile.partial(content, file, { ext: '.html', isHtmlLike: true }); } var sourceMapRelative = conf.sourceMapRelative; if (sourceMapRelative) { delete conf.sourceMapRelative; } // 出于安全考虑,不使用原始路径 // conf.filename = file.subpath; var result = babel.transform(content, conf); // 添加resourcemap输出 if (result.map) { var mapping = fis.file.wrap(file.dirname + '/' + file.filename + file.rExt + '.map'); mapping.setContent(JSON.stringify(result.map, null, 4)); var url = sourceMapRelative ? ('./' + file.basename + '.map').replace('jsx', 'js') : mapping.getUrl(fis.compile.settings.hash, fis.compile.settings.domain); result.code = result.code.replace(/\n?\s*\/\/#\ssourceMappingURL=.*?(?:\n|$)/g, ''); result.code += '\n//# sourceMappingURL=' + url + '\n'; file.derived.push(mapping); } return result.code; };
Sorry, something went wrong.
No branches or pull requests
sourceMaps: true 配置没有产生 .map 文件
fis.match('{*.jsx,*:jsx}', { parser: fis.plugin('babel-6.x', { sourceMaps: true }), rExt: '.js' });
https://github.com/fex-team/fis3-demo/tree/master/use-react
换成 babel-6.x .map 文件产生
The text was updated successfully, but these errors were encountered: