Skip to content

Commit

Permalink
CSS scanner works
Browse files Browse the repository at this point in the history
Former-commit-id: 4ca1e17
  • Loading branch information
Jarred-Sumner committed Jun 17, 2021
1 parent e1677bb commit 9ca283b
Show file tree
Hide file tree
Showing 21 changed files with 2,076 additions and 3,033 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ out
esbuilddir
*.jsb
parceldist
esbuilddir
esbuilddir
outdir/
outcss
7 changes: 6 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"request": "launch",
"name": "Dev Launch",
"program": "${workspaceFolder}/build/debug/macos-x86_64/esdev",
"args": ["optional-chain-polyfill.js", "--resolve=disable"],
"args": [
"./simple.css",
"--resolve=dev",
"--outdir=outcss",
"--public-url=https://localhost:9000/"
],
"cwd": "${workspaceFolder}/src/test/fixtures",
"console": "internalConsole"
},
Expand Down
16 changes: 9 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const resolve_path = @import("./src/resolver/resolve_path.zig");
pub fn addPicoHTTP(step: *std.build.LibExeObjStep, dir: []const u8) void {
const picohttp = step.addPackage(.{
.name = "picohttp",
.path = "src/deps/picohttp.zig",
.path = .{ .path = "src/deps/picohttp.zig" },
});

step.addObjectFile(
Expand Down Expand Up @@ -35,7 +35,7 @@ pub fn build(b: *std.build.Builder) void {
if (target.getOsTag() == .wasi) {
exe.enable_wasmtime = true;
exe = b.addExecutable("esdev", "src/main_wasi.zig");
exe.is_dynamic = true;
exe.linkage = .dynamic;
exe.setOutputDir(output_dir);
} else if (target.getCpuArch().isWasm()) {
// exe = b.addExecutable(
Expand All @@ -60,15 +60,15 @@ pub fn build(b: *std.build.Builder) void {

lib.setOutputDir(output_dir);
lib.want_lto = true;
b.install_path = lib.getOutputPath();
b.install_path = lib.getOutputSource().getPath(b);

std.debug.print("Build: ./{s}\n", .{lib.getOutputPath()});
std.debug.print("Build: ./{s}\n", .{b.install_path});
b.default_step.dependOn(&lib.step);
b.verbose_link = true;
lib.setTarget(target);
lib.setBuildMode(mode);

std.fs.deleteTreeAbsolute(std.fs.path.join(std.heap.page_allocator, &.{ cwd, lib.getOutputPath() }) catch unreachable) catch {};
std.fs.deleteTreeAbsolute(std.fs.path.join(std.heap.page_allocator, &.{ cwd, lib.getOutputSource().getPath(b) }) catch unreachable) catch {};
var install = b.getInstallStep();
lib.strip = false;
lib.install();
Expand All @@ -92,11 +92,11 @@ pub fn build(b: *std.build.Builder) void {

exe.addPackage(.{
.name = "clap",
.path = "src/deps/zig-clap/clap.zig",
.path = .{ .path = "src/deps/zig-clap/clap.zig" },
});

exe.setOutputDir(output_dir);
std.debug.print("Build: ./{s}\n", .{exe.getOutputPath()});

var walker = std.fs.walkPath(std.heap.page_allocator, cwd) catch unreachable;
if (std.builtin.is_test) {
while (walker.next() catch unreachable) |entry| {
Expand Down Expand Up @@ -141,4 +141,6 @@ pub fn build(b: *std.build.Builder) void {

const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);

std.debug.print("Build: ./{s}/{s}\n", .{ output_dir, "esdev" });
}
113 changes: 0 additions & 113 deletions outdir/index.css

This file was deleted.

Loading

0 comments on commit 9ca283b

Please sign in to comment.