diff --git a/tools/bundler.js b/tools/bundler.js index c4229932e5..8ac868c0a4 100644 --- a/tools/bundler.js +++ b/tools/bundler.js @@ -647,15 +647,6 @@ _.extend(Target.prototype, { var f = new File({data: resource.data, cacheable: false}); var relPath = stripLeadingSlash(resource.servePath); - - if (archinfo.matches(self.arch, "web.cordova")) { - relPath = path.join(resource.type, relPath); - - if (resource.type === "css") { - f.targetPath = relPath; - } - } - f.setTargetPathFromRelPath(relPath); if (isWeb) { diff --git a/tools/commands-cordova.js b/tools/commands-cordova.js index 5cab083b96..bafa090267 100644 --- a/tools/commands-cordova.js +++ b/tools/commands-cordova.js @@ -44,15 +44,9 @@ var generateCordovaBoilerplate = function (clientDir, options) { var clientJsonPath = path.join(clientDir, 'program.json'); var clientJson = JSON.parse(fs.readFileSync(clientJsonPath, 'utf8')); - var manifest = _.map(clientJson.manifest, function (item) { - if (item.type === 'js') - return _.extend(item, { url: ('/js' + item.url) }); - return item; - }); - var meteorRelease = project.getMeteorReleaseVersion(); var Boilerplate = getLoadedPackages()['boilerplate-generator'].Boilerplate; - var boilerplate = new Boilerplate('web.cordova', manifest, { + var boilerplate = new Boilerplate('web.cordova', clientJson.manifest, { urlMapper: function (url) { return url ? url.substr(1) : ''; }, pathMapper: function (p) { return path.join(clientDir, p); }, baseDataExtension: { @@ -104,13 +98,15 @@ cordova.checkIsValidPlugin = function (name) { utils.ensureOnlyExactVersions(pluginHash); }; -var getBundle = function (bundlePath, webArchs) { +// options +// - debug +var getBundle = function (bundlePath, webArchs, options) { var bundler = require(path.join(__dirname, 'bundler.js')); var bundleResult = bundler.bundle({ outputPath: bundlePath, buildOptions: { - minify: false, // XXX ! options.debug, + minify: ! options.debug, arch: archinfo.host(), webArchs: webArchs } @@ -196,7 +192,7 @@ cordova.ensureCordovaPlugins = function (localPath, options) { var bundlePath = path.join(localPath, 'build-tar'); var webArchName = 'web.cordova'; plugins = - getBundle(bundlePath, [webArchName]).starManifest.cordovaDependencies; + getBundle(bundlePath, [webArchName], options).starManifest.cordovaDependencies; files.rm_recursive(bundlePath); } // XXX the project-level cordova plugins deps override the package-level ones @@ -301,7 +297,7 @@ var buildCordova = function (localPath, options) { var cordovaProgramPath = path.join(programPath, webArchName); var cordovaProgramAppPath = path.join(cordovaProgramPath, 'app'); - var bundle = getBundle(bundlePath, [webArchName]); + var bundle = getBundle(bundlePath, [webArchName], options); cordova.ensureCordovaProject(localPath, options.appName); cordova.ensureCordovaPlatforms(localPath);