UNPKG

enoad-component-web

Version:

针对web端的控件

83 lines 2.87 kB
function publish() { var publishEnv = fis.media('publish'); publishEnv.get('project.ignore').push('lib/**'); publishEnv.set('project.files', ['/src/assets/scss/**/*', '/src/**']); publishEnv.match('/src/(**)', { release: '/$1', relative: true }); publishEnv.match('/src/**.{jsx,tsx,js,ts}', { parser: [ // docsGennerator, fis.plugin('typescript', { importHelpers: true, sourceMap: true, experimentalDecorators: true, esModuleInterop: true, allowUmdGlobalAccess: true }), function (contents) { return contents.replace(/(?:\w+\.)?\b__uri\s*\(\s*('|")(.*?)\1\s*\)/g, function (_, quote, value) { var str = quote + value + quote; return ('(function(){try {return __uri(' + str + ')} catch(e) {return ' + str + '}})()'); }); } ], preprocessor: null }); publishEnv.match('*.scss', { parser: fis.plugin('sass', { sourceMap: false }), }); publishEnv.match('_*.scss', { release: false }); publishEnv.match('*', { deploy: fis.plugin('local-deliver', { to: fis.get('options.d') || fis.get('options.desc') || './lib' }) }); publishEnv.match('/src/**.{jsx,tsx,js,ts,svg}', { isMod: false, standard: false }); publishEnv.match('/src/**.{jsx,tsx,js,ts}', { postprocessor: function (content, file) { return content .replace(/^''/gm, '') .replace(/\/\/# sourceMappingURL=\//g, '//# sourceMappingURL=./'); } }); publishEnv.match('*.scss', { postprocessor: function (content, file) { return content.replace(/\/\*# sourceMappingURL=\//g, '/*# sourceMappingURL=./'); } }); publishEnv.match('::package', { postpackager: function (ret) { Object.keys(ret.src).forEach(function (subpath) { var file = ret.src[subpath]; if (!file.isText()) { return; } var content = file.getContent(); if (subpath === '/src/components/icons.tsx') { content = content.replace(/\.svg/g, '.js'); } else { content = content.replace(/@require\s+(?:\.\.\/)?node_modules\//g, '@require '); } file.setContent(content); }); } }); // publishEnv.unhook('node_modules'); publishEnv.hook('relative'); } module.exports = publish; //# sourceMappingURL=fis-conf-npm.js.map