Skip to content

Commit

Permalink
fix(cli): fixed compile entry
Browse files Browse the repository at this point in the history
  • Loading branch information
dlhandsome authored and Gcaufy committed Oct 2, 2018
1 parent 67474ca commit c15d0d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/cli/core/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ const initCompiler = require('./init/compiler');
const initParser = require('./init/parser');
const initPlugin = require('./init/plugin');

const ENTRY_FILE = 'app.wpy';

class Compile extends Hook {
constructor (opt) {
super();
let self = this;

this.version = require('../package.json').version;
this.options = opt;
this.options.entry = path.resolve(path.join(this.options.src, ENTRY_FILE));

if (!path.isAbsolute(opt.entry)) {
this.options.entry = path.resolve(path.join(opt.src, opt.entry));
}

this.clear();
this.resolvers = {};

Expand Down
1 change: 1 addition & 0 deletions packages/cli/core/parseOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const fs = require('fs');

const DEFAULT_OPTIONS = {
'entry': { type: String, default: 'app.wpy' },
'src': { type: String, default: 'src' },
'target': { type: String, default: 'weapp' },
'static': { type: [String, Array], default: 'static' },
Expand Down

0 comments on commit c15d0d5

Please sign in to comment.