Building is not fun, especially so many choices (gulp, webpack, systemjs, ...) to make a building system for you (or your team).
So I decide to jump out of this shit pit. Here is my solution.
This build script is for single page app. It just concat all project scripts to one, and compile a less style. No framework specified.
npm install -g foolish
Any directory is a valid foolish project, even if it's empty. Some filename is special but not required:
index.html: this is the landing page.
main.js: this script will be at the top in combiled script.
run.js: this script will be at the ned in combiled script.
main.less: write your less style here.
app.js: only use this in
index.html, your project should not have this file, it's combined output script filename.
app.css: only use this in
index.html, your project should not have this file, it's compile style filename.
Here is a basic web page project which contains script and stylesheet:
mkdir my-foolish-project && cd my-follish-project.
echo '<link href="app.css" rel="stylesheet"></link>' > index.html.
foolish server, a small http server will start listening on port 3000.
Look at the initialize step, I think you already realized there is no
app.css. Those files are virtual, which generated by development server or building script.
app.js will load all your scripts,
app.css is generated from
You can use
--port parameter to change the server port.
foolish under your project directory, then you will get a
dist directory which contains what you want.
The building prosess is simple:
.jsfiles in your project directory (except
main.jswill at head and
run.jswill be the last.
dist/app.css, copy them to
A: Just create a
<script> tag in
index.html to reference a script file. The file location can be in internect (like CDN server) or just a local dependency in
npm install is welcome).
A: Sure but not in
foolish. You can do this by shell command.
PR is welcome. I'll very happy if someone tell me some feature is useless and can be drop out.