Move webpack dotenv to common conf
This commit is contained in:
@@ -3,6 +3,7 @@ const {resolve} = require("path");
|
|||||||
const {CheckerPlugin} = require("awesome-typescript-loader");
|
const {CheckerPlugin} = require("awesome-typescript-loader");
|
||||||
const StyleLintPlugin = require("stylelint-webpack-plugin");
|
const StyleLintPlugin = require("stylelint-webpack-plugin");
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
|
const Dotenv = require("dotenv-webpack");
|
||||||
|
|
||||||
module.exports = function (env, argv) {
|
module.exports = function (env, argv) {
|
||||||
const config = {};
|
const config = {};
|
||||||
@@ -44,6 +45,9 @@ module.exports = function (env, argv) {
|
|||||||
new webpack.DefinePlugin(envVars),
|
new webpack.DefinePlugin(envVars),
|
||||||
new CheckerPlugin(),
|
new CheckerPlugin(),
|
||||||
new StyleLintPlugin(),
|
new StyleLintPlugin(),
|
||||||
|
new Dotenv({
|
||||||
|
path: "./.env"
|
||||||
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
config.performance = {
|
config.performance = {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ const merge = require("webpack-merge");
|
|||||||
const webpack = require("webpack");
|
const webpack = require("webpack");
|
||||||
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
|
const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||||
const Dotenv = require("dotenv-webpack");
|
|
||||||
|
|
||||||
const commonConfig = require("./common.js");
|
const commonConfig = require("./common.js");
|
||||||
|
|
||||||
@@ -28,9 +27,6 @@ module.exports = function (env, argv) {
|
|||||||
};
|
};
|
||||||
base.devtool = "cheap-module-eval-source-map";
|
base.devtool = "cheap-module-eval-source-map";
|
||||||
base.plugins = base.plugins.concat([
|
base.plugins = base.plugins.concat([
|
||||||
new Dotenv({
|
|
||||||
path: "./.env"
|
|
||||||
}),
|
|
||||||
new FaviconsWebpackPlugin({
|
new FaviconsWebpackPlugin({
|
||||||
logo: "./assets/img/favicon.png",
|
logo: "./assets/img/favicon.png",
|
||||||
prefix: "assets/icons/",
|
prefix: "assets/icons/",
|
||||||
|
|||||||
Reference in New Issue
Block a user