修复 gh-pages 编译问题

This commit is contained in:
2betop 2021-01-19 14:30:01 +08:00
parent 11a0368b07
commit 5257f7df54

View File

@ -126,15 +126,6 @@ fis.match('/docs/**.md', {
isMod: true isMod: true
}); });
fis.on('compile:end', function (file) {
if (
file.subpath === '/src/index.tsx' ||
file.subpath === '/examples/mod.js'
) {
file.setContent(file.getContent().replace('@version', package.version));
}
});
fis.on('compile:optimizer', function (file) { fis.on('compile:optimizer', function (file) {
if (file.isJsLike && file.isMod) { if (file.isJsLike && file.isMod) {
var contents = file.getContent(); var contents = file.getContent();
@ -255,6 +246,15 @@ if (fis.project.currentMedia() === 'publish') {
publishEnv.get('project.ignore').push('lib/**'); publishEnv.get('project.ignore').push('lib/**');
publishEnv.set('project.files', ['/scss/**', '/src/**']); publishEnv.set('project.files', ['/scss/**', '/src/**']);
fis.on('compile:end', function (file) {
if (
file.subpath === '/src/index.tsx' ||
file.subpath === '/examples/mod.js'
) {
file.setContent(file.getContent().replace('@version', package.version));
}
});
publishEnv.match('/scss/(**)', { publishEnv.match('/scss/(**)', {
release: '/$1', release: '/$1',
relative: true relative: true
@ -355,6 +355,15 @@ if (fis.project.currentMedia() === 'publish') {
} else if (fis.project.currentMedia() === 'publish-sdk') { } else if (fis.project.currentMedia() === 'publish-sdk') {
const env = fis.media('publish-sdk'); const env = fis.media('publish-sdk');
fis.on('compile:end', function (file) {
if (
file.subpath === '/src/index.tsx' ||
file.subpath === '/examples/mod.js'
) {
file.setContent(file.getContent().replace('@version', package.version));
}
});
env.get('project.ignore').push('sdk/**'); env.get('project.ignore').push('sdk/**');
env.set('project.files', ['examples/sdk-placeholder.html']); env.set('project.files', ['examples/sdk-placeholder.html']);