Getting startedConfigurationFAQ

Getting started

Follow these steps to create your Antwar site.

1. Set up a project (mkdir demo && cd demo && npm init -y)

2. Install Antwar core

npm i antwar -D

3. Create a bootstrap script. This will be used to run the site.

antwar.bootstrap.js

const antwar = require("../");

const environment = process.argv[2];

antwar[environment]({
  environment,
  configurationPaths: {
    antwar: require.resolve("./antwar.config"),
    webpack: require.resolve("./webpack.config"),
  },
})
  .then(() => {
    if (environment !== "build") {
      console.log("Surf to localhost:3000");
    }
  })
  .catch(err => {
    console.error(err);

    process.exit(1);
  });

4. Set up scripts to run it

package.json

{
  "scripts": {
    "start": "node ./antwar.bootstrap.js develop",
    "build": "node ./antwar.bootstrap.js build"
  },
  ...
}

5. Set up Antwar and webpack configuration. See the documentation and the Antwar repository (site/ and smoketest/ directories) for reference.

6. Add initial content and start developing.