Skip to content

Commit dd7fd87

Browse files
committed
changes made to webpack config
1 parent fbee89c commit dd7fd87

File tree

7 files changed

+8
-16
lines changed

7 files changed

+8
-16
lines changed

config/filename.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
const path = require('path');
21
const env = require('./isDev');
3-
const paths = require('./paths');
42

53
module.exports = {
64
filename(ext) {

config/isDev.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const key = process.env.NODE_ENV;
22
module.exports = {
33
isDev: key === 'development',
4-
isProd: !this.isDev,
54
isPlugin: key === 'plugin',
65
};

config/optimization.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
},
1111
};
1212

13-
if (env.isProd) {
13+
if (!env.isDev) {
1414
config.minimizer = [
1515
new TerserPlugin({
1616
parallel: true,

config/webpack.common.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const devServer = require('./webpack.devServer.js');
1010

1111
let config = null;
1212

13-
const pluginM = ['@plugins/importPlugin.ts'];
13+
const plugin = ['@plugins/importPlugin.ts'];
1414
const points = [];
1515

16-
if (env.isProd) {
16+
if (!env.isDev) {
1717
points.push('./index.ts');
1818
} else {
1919
points.push('webpack/hot/dev-server');
@@ -22,11 +22,11 @@ if (env.isProd) {
2222

2323
if (env.isPlugin) {
2424
config = {
25-
plugin: pluginM,
25+
plugin,
2626
};
2727
} else {
2828
config = {
29-
plugin: pluginM,
29+
plugin,
3030
demo: points,
3131
};
3232
}

config/webpack.devServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const paths = require('./paths');
22

33
module.exports = {
4-
devServer: { // локальный сервер который будет запущен на http://localhost:8080/
4+
devServer: {
55
watchFiles: [
66
`${paths.src}/components/**/*.pug`,
77
`${paths.src}/pages/**/*.pug`,

config/webpack.module.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
const path = require('path');
21
const cssLoaders = require('./cssLoaders');
3-
const paths = require('./paths');
42

53
module.exports = {
64

config/webpack.plugins.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ const paths = require('./paths');
1717

1818
const pagesDir = path.join(paths.src, '/pages/');
1919

20-
const pages = [];
21-
fs.readdirSync(pagesDir).forEach((file) => {
22-
pages.push(file.split('/', 2));
20+
const pages = fs.readdirSync(pagesDir).map((file) => {
21+
return file.split('/', 2);
2322
});
2423

2524
const description = 'Узнайте, как использовать Range Slider Fox'
@@ -117,8 +116,6 @@ plugins.push(
117116
new FoxFavicon({
118117
src: path.join(paths.src, paths.assets, 'images/icon/favicon.png'),
119118
path: 'assets/favicons/',
120-
// pathManifest: '/assets/favicons/',
121-
// 'https://plugins.su/
122119
urlIcon: 'assets/favicons/',
123120
devMode: env.isPlugin ? true : env.isDev,
124121
appName: 'Plugin Range Slider Fox',

0 commit comments

Comments
 (0)