Browse Source

fix: update the compile function

master
cbbfcd 4 years ago
parent
commit
242f7f481d
  1. 4
      packages/cli/src/cmd/dev/index.js

4
packages/cli/src/cmd/dev/index.js

@ -2,7 +2,7 @@ const path = require('path');
const fs = require('fs-extra'); const fs = require('fs-extra');
const Base = require('../base'); const Base = require('../base');
const mergePkg = require('./mergePkg'); const mergePkg = require('./mergePkg');
const compileCode = require('@imove/compile-code'); const { compileForProject } = require('@imove/compile-code');
const { createServer } = require('../../utils/server'); const { createServer } = require('../../utils/server');
const noop = () => {}; const noop = () => {};
@ -38,7 +38,7 @@ class Dev extends Base {
// compile // compile
try { try {
const { dsl } = req.body; const { dsl } = req.body;
const output = compileCode(dsl, plugins); const output = compileForProject(dsl, plugins);
await this.writeOutputIntoFiles(outputPath, output); await this.writeOutputIntoFiles(outputPath, output);
await mergePkg(dsl, this.projectPath); await mergePkg(dsl, this.projectPath);
await fs.outputFile(CACHE_DSL_FILE, JSON.stringify(dsl, null, 2)); await fs.outputFile(CACHE_DSL_FILE, JSON.stringify(dsl, null, 2));

Loading…
Cancel
Save