2017-06-28 22:37:33 +03:00
|
|
|
import baseConfig from "./rollup.base.config.js";
|
|
|
|
import resolve from "rollup-plugin-node-resolve";
|
|
|
|
import commonjs from "rollup-plugin-commonjs";
|
|
|
|
import json from "rollup-plugin-json";
|
2017-09-29 10:27:50 +03:00
|
|
|
import replace from "rollup-plugin-replace";
|
2017-11-22 14:27:40 +03:00
|
|
|
import * as path from "path";
|
|
|
|
|
|
|
|
const external = ["assert"];
|
|
|
|
|
|
|
|
if (process.env.BUILD_TARGET !== "website") {
|
2017-12-26 04:23:50 +03:00
|
|
|
external.push(path.resolve("src/common/third-party.js"));
|
2017-11-22 14:27:40 +03:00
|
|
|
}
|
2017-05-29 07:49:41 +03:00
|
|
|
|
2017-06-08 01:20:48 +03:00
|
|
|
export default Object.assign(baseConfig, {
|
2017-06-28 22:37:33 +03:00
|
|
|
entry: "index.js",
|
|
|
|
dest: "dist/index.js",
|
|
|
|
format: "cjs",
|
2017-09-29 10:27:50 +03:00
|
|
|
plugins: [
|
|
|
|
replace({
|
2018-01-05 13:09:51 +03:00
|
|
|
"process.env.NODE_ENV": JSON.stringify("production"),
|
|
|
|
// See comment in jest.config.js
|
|
|
|
"require('graceful-fs')": "require('fs')"
|
2017-09-29 10:27:50 +03:00
|
|
|
}),
|
|
|
|
json(),
|
2018-01-05 13:09:51 +03:00
|
|
|
resolve({
|
|
|
|
preferBuiltins: true,
|
|
|
|
extensions: [".js", ".json"]
|
|
|
|
}),
|
2017-09-29 10:27:50 +03:00
|
|
|
commonjs()
|
|
|
|
],
|
2017-11-22 14:27:40 +03:00
|
|
|
external,
|
|
|
|
paths: {
|
2017-12-26 04:23:50 +03:00
|
|
|
[path.resolve("src/common/third-party.js")]: "./third-party"
|
2017-11-22 14:27:40 +03:00
|
|
|
}
|
2017-06-08 01:20:48 +03:00
|
|
|
});
|