mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
WIP fixing minifiers
This commit is contained in:
@@ -51,8 +51,13 @@ var mergeCss = function (css) {
|
||||
var ast = CssTools.parseCss(file.getContentsAsString(), parseOptions);
|
||||
ast.filename = filename;
|
||||
} catch (e) {
|
||||
// XCXC regexp is incorrect
|
||||
var match = e.message.match(/^(.*):(\d+):(\d+): (.*)$/gi);
|
||||
|
||||
file.error({
|
||||
message: e.message
|
||||
message: match[1],
|
||||
line: match[2],
|
||||
column: match[3]
|
||||
});
|
||||
|
||||
return { type: "stylesheet", stylesheet: { rules: [] },
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import buildmessage from './buildmessage.js';
|
||||
const buildPluginModule = require('./build-plugin.js');
|
||||
|
||||
class InputFile extends buildPluginModule.InputFile {
|
||||
@@ -25,6 +26,16 @@ class InputFile extends buildPluginModule.InputFile {
|
||||
return this._arch;
|
||||
}
|
||||
|
||||
error({message, sourcePath, line, column, func}) {
|
||||
const relPath = this.getPathInBundle();
|
||||
buildmessage.error(message || ('error minifying ' + relPath), {
|
||||
file: sourcePath || relPath,
|
||||
line: line ? line : undefined,
|
||||
column: column ? column : undefined,
|
||||
func: func ? func : undefined
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary Returns the path of the compiled file in the bundle.
|
||||
* @memberof InputFile
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
# but you can also edit it by hand.
|
||||
|
||||
meteor-platform
|
||||
standard-minifiers
|
||||
|
||||
@@ -81,16 +81,16 @@ selftest.define("run", function () {
|
||||
run.match("restarted");
|
||||
|
||||
// Crash just once, then restart successfully
|
||||
s.write("crash.js",
|
||||
"var fs = Npm.require('fs')\n" +
|
||||
"var path = Npm.require('path')\n" +
|
||||
"var crashmark = path.join(process.env.METEOR_TEST_TMP, 'crashed');\n" +
|
||||
"try {\n" +
|
||||
" fs.readFileSync(crashmark);\n" +
|
||||
"} catch (e) {\n" +
|
||||
" fs.writeFileSync(crashmark);\n" +
|
||||
" process.exit(137);\n" +
|
||||
"}\n");
|
||||
s.write("crash.js", `
|
||||
var fs = Npm.require('fs');
|
||||
var path = Npm.require('path');
|
||||
var crashmark = path.join(process.env.METEOR_TEST_TMP, 'crashed');
|
||||
try {
|
||||
fs.readFileSync(crashmark);
|
||||
} catch (e) {
|
||||
fs.writeFileSync(crashmark);
|
||||
process.exit(137);
|
||||
}`);
|
||||
run.waitSecs(5);
|
||||
run.match("with code: 137");
|
||||
run.waitSecs(5);
|
||||
|
||||
@@ -375,6 +375,7 @@ _.extend(warehouse, {
|
||||
dontWriteFreshFile) {
|
||||
fiberHelpers.parallelEach(
|
||||
packagesToDownload, function (version, name) {
|
||||
console.log(typeof name, typeof version)
|
||||
var packageDir = files.pathJoin(
|
||||
warehouseDirectory, 'packages', name, version);
|
||||
var packageUrl = WAREHOUSE_URLBASE + "/packages/" + name +
|
||||
|
||||
Reference in New Issue
Block a user