akkoma-fe/build/build.js

37 lines
858 B
JavaScript
Raw Normal View History

2016-10-26 14:46:32 +00:00
// https://github.com/shelljs/shelljs
2024-06-23 02:02:45 +00:00
require("./check-versions")();
require("shelljs/global");
env.NODE_ENV = "production";
2016-10-26 14:46:32 +00:00
2024-06-23 02:02:45 +00:00
var path = require("path");
var config = require("../config");
var webpack = require("webpack");
var webpackConfig = require("./webpack.prod.conf");
2016-10-26 14:46:32 +00:00
console.log(
2024-06-23 02:02:45 +00:00
" Tip:\n" +
" Built files are meant to be served over an HTTP server.\n" +
" Opening index.html over file:// won't work.\n",
);
2016-10-26 14:46:32 +00:00
2024-06-23 02:02:45 +00:00
var assetsPath = path.join(
config.build.assetsRoot,
config.build.assetsSubDirectory,
);
rm("-rf", assetsPath);
mkdir("-p", assetsPath);
cp("-R", "static/*", assetsPath);
2016-10-26 14:46:32 +00:00
webpack(webpackConfig, function (err, stats) {
2024-06-23 02:02:45 +00:00
if (err) throw err;
process.stdout.write(
stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false,
}) + "\n",
);
});