generator-reackt 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +4 -4
- package/.stylelintrc +104 -0
- package/LICENSE +9 -7
- package/README.md +18 -18
- package/generators/app/index.js +1 -307
- package/generators/component/index.js +1 -56
- package/generators/es.regexp.flags-ccfbed60.js +1 -0
- package/generators/module/index.js +1 -117
- package/generators/util/fs.js +1 -31
- package/package.json +33 -29
- package/templates/app/.babelrc +9 -9
- package/templates/app/.browserslistrc +3 -3
- package/templates/app/.editorconfig +11 -11
- package/templates/app/.esdoc.json +23 -23
- package/templates/app/.eslintrc.js +5 -13
- package/templates/app/.lintstagedrc +4 -4
- package/templates/app/.prettierrc +4 -4
- package/templates/app/.storybook/addons.js +1 -1
- package/templates/app/.storybook/config.js +14 -14
- package/templates/app/.storybook/webpack.config.babel.js +7 -7
- package/templates/app/.stylelintrc +271 -277
- package/templates/app/gitignore +2 -0
- package/templates/app/jest.config.js +15 -15
- package/templates/app/jsconfig.json +8 -8
- package/templates/app/package.json +18 -18
- package/templates/app/src/components/App.js +14 -0
- package/templates/app/src/icons.js +3 -3
- package/templates/app/src/index.html +10 -10
- package/templates/app/src/index.js +50 -54
- package/templates/app/src/index.scss +16 -17
- package/templates/app/src/reducers/application.js +21 -21
- package/templates/app/src/reducers/index.js +7 -7
- package/templates/app/src/sagas/application.js +9 -9
- package/templates/app/src/sagas/index.js +7 -7
- package/templates/app/src/selectors/application.js +1 -1
- package/templates/app/src/selectors/application.test.js +13 -13
- package/templates/app/src/utils/index.js +36 -32
- package/templates/app/webpack.config.babel.js +103 -109
- package/templates/component/index.js +19 -19
- package/templates/component/index.test.js +14 -14
- package/templates/module/reducer/index.js +20 -20
- package/templates/module/saga/index.js +9 -9
- package/CHANGELOG.md +0 -227
- package/templates/app/src/components/App/App.js +0 -19
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= package.name %>",
|
|
3
|
-
"version": "<%= package.version %>",
|
|
4
|
-
"description": "<%= package.description %>",
|
|
5
|
-
"author": "<%= author.name %> <<%= author.email %>>",
|
|
6
|
-
"license": "<%= package.license %>",
|
|
7
|
-
"scripts": {
|
|
8
|
-
<% if (flags.addStorybook) { %>
|
|
9
|
-
"storybook": "start-storybook",
|
|
10
|
-
<% } %>
|
|
11
|
-
<% if (flags.addJest) { %>
|
|
12
|
-
"test": "jest",
|
|
13
|
-
<% } %>
|
|
14
|
-
"build": "cross-env NODE_ENV=production webpack",
|
|
15
|
-
"start": "cross-env NODE_ENV=development webpack serve"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {},
|
|
18
|
-
"devDependencies": {}
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= package.name %>",
|
|
3
|
+
"version": "<%= package.version %>",
|
|
4
|
+
"description": "<%= package.description %>",
|
|
5
|
+
"author": "<%= author.name %> <<%= author.email %>>",
|
|
6
|
+
"license": "<%= package.license %>",
|
|
7
|
+
"scripts": {
|
|
8
|
+
<% if (flags.addStorybook) { %>
|
|
9
|
+
"storybook": "start-storybook",
|
|
10
|
+
<% } %>
|
|
11
|
+
<% if (flags.addJest) { %>
|
|
12
|
+
"test": "jest",
|
|
13
|
+
<% } %>
|
|
14
|
+
"build": "cross-env NODE_ENV=production webpack",
|
|
15
|
+
"start": "cross-env NODE_ENV=development webpack serve"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {},
|
|
18
|
+
"devDependencies": {}
|
|
19
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
-
import { faCircle } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
|
|
1
|
+
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { faCircle } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
|
|
4
4
|
library.add(faCircle);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width" />
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<div id="root"></div>
|
|
9
|
-
</body>
|
|
10
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width" />
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div id="root"></div>
|
|
9
|
+
</body>
|
|
10
|
+
</html>
|
|
@@ -1,54 +1,50 @@
|
|
|
1
|
-
import 'core-js/stable';
|
|
2
|
-
import 'regenerator-runtime/runtime';
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import './
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
export default App;
|
|
54
|
-
|
|
1
|
+
import 'core-js/stable';
|
|
2
|
+
import 'regenerator-runtime/runtime';
|
|
3
|
+
|
|
4
|
+
import ReactDOM from 'react-dom';
|
|
5
|
+
import { BrowserRouter as Router } from 'react-router-dom';
|
|
6
|
+
<% if (flags.addRedux) { %>
|
|
7
|
+
import { Provider } from 'react-redux';
|
|
8
|
+
import createSagaMiddleware from 'redux-saga';
|
|
9
|
+
import { applyMiddleware, createStore, compose } from 'redux';
|
|
10
|
+
<% } %>
|
|
11
|
+
|
|
12
|
+
<% if (flags.addFontAwesome) { %>
|
|
13
|
+
import './icons.js';
|
|
14
|
+
<% } %>
|
|
15
|
+
import './index.scss';
|
|
16
|
+
import App from './components/App';
|
|
17
|
+
<% if (flags.addRedux) { %>
|
|
18
|
+
import rootSaga from './sagas';
|
|
19
|
+
import rootReducer from './reducers';
|
|
20
|
+
|
|
21
|
+
/* eslint-disable no-underscore-dangle */
|
|
22
|
+
const composer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
|
|
23
|
+
/* eslint-enable */
|
|
24
|
+
|
|
25
|
+
const sagaMiddleware = createSagaMiddleware();
|
|
26
|
+
const enhancers = composer(applyMiddleware(sagaMiddleware));
|
|
27
|
+
|
|
28
|
+
export const store = createStore(rootReducer, {}, enhancers);
|
|
29
|
+
|
|
30
|
+
if (module.hot) {
|
|
31
|
+
module.hot.accept('./reducers', () => {
|
|
32
|
+
store.replaceReducer(require('./reducers').default);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
sagaMiddleware.run(rootSaga);
|
|
37
|
+
<% } %>
|
|
38
|
+
|
|
39
|
+
ReactDOM.render(
|
|
40
|
+
<Router>
|
|
41
|
+
<% if (flags.addRedux) { %>
|
|
42
|
+
<Provider store={store}>
|
|
43
|
+
<App />
|
|
44
|
+
</Provider>
|
|
45
|
+
<% } else { %>
|
|
46
|
+
<App />
|
|
47
|
+
<% } %>
|
|
48
|
+
</Router>,
|
|
49
|
+
document.getElementById('root')
|
|
50
|
+
);
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
<% if (styleFramework === 'bulma') { %>
|
|
2
|
-
@charset "utf-8";
|
|
3
|
-
<% } %>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@import "~uikit/src/scss/
|
|
9
|
-
@import "~uikit/src/scss/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<% } %>
|
|
1
|
+
<% if (styleFramework === 'bulma') { %>
|
|
2
|
+
@charset "utf-8";
|
|
3
|
+
<% } %>
|
|
4
|
+
<% if (styleFramework === 'bootstrap') { %>
|
|
5
|
+
@import "~bootstrap/scss/bootstrap";
|
|
6
|
+
<% } else if (styleFramework === 'uikit') { %>
|
|
7
|
+
@import "~uikit/src/scss/variables-theme";
|
|
8
|
+
@import "~uikit/src/scss/mixins-theme";
|
|
9
|
+
@import "~uikit/src/scss/uikit-theme";
|
|
10
|
+
<% } else if (styleFramework === 'foundation') { %>
|
|
11
|
+
@import "~foundation-sites/scss/foundation";
|
|
12
|
+
<% } else if (styleFramework === 'materialize') { %>
|
|
13
|
+
@import "~materialize-css/sass/materialize";
|
|
14
|
+
<% } else if (styleFramework === 'bulma') { %>
|
|
15
|
+
@import "~bulma/bulma";
|
|
16
|
+
<% } %>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { buildActions } from 'utils';
|
|
2
|
-
|
|
3
|
-
export const types = buildActions('application', ['INIT_APP']);
|
|
4
|
-
|
|
5
|
-
const initApp = () => ({
|
|
6
|
-
type: types.INIT_APP
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const actions = {
|
|
10
|
-
initApp
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const initialState = {};
|
|
14
|
-
|
|
15
|
-
export const reducer = (state = initialState, action = {}) => {
|
|
16
|
-
switch (action.type) {
|
|
17
|
-
default:
|
|
18
|
-
return state;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
1
|
+
import { buildActions } from 'utils';
|
|
2
|
+
|
|
3
|
+
export const types = buildActions('application', ['INIT_APP']);
|
|
4
|
+
|
|
5
|
+
const initApp = () => ({
|
|
6
|
+
type: types.INIT_APP
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const actions = {
|
|
10
|
+
initApp
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const initialState = {};
|
|
14
|
+
|
|
15
|
+
export const reducer = (state = initialState, action = {}) => {
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
default:
|
|
18
|
+
return state;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { combineReducers } from 'redux';
|
|
2
|
-
|
|
3
|
-
import { reducer as application } from './application';
|
|
4
|
-
|
|
5
|
-
export default combineReducers({
|
|
6
|
-
application
|
|
7
|
-
});
|
|
1
|
+
import { combineReducers } from 'redux';
|
|
2
|
+
|
|
3
|
+
import { reducer as application } from './application';
|
|
4
|
+
|
|
5
|
+
export default combineReducers({
|
|
6
|
+
application
|
|
7
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { all } from 'redux-saga/effects';
|
|
2
|
-
|
|
3
|
-
export const workers = {};
|
|
4
|
-
|
|
5
|
-
export const watchers = {};
|
|
6
|
-
|
|
7
|
-
export default function* saga() {
|
|
8
|
-
yield all(Object.values(watchers).map(watcher => watcher()));
|
|
9
|
-
}
|
|
1
|
+
import { all } from 'redux-saga/effects';
|
|
2
|
+
|
|
3
|
+
export const workers = {};
|
|
4
|
+
|
|
5
|
+
export const watchers = {};
|
|
6
|
+
|
|
7
|
+
export default function* saga() {
|
|
8
|
+
yield all(Object.values(watchers).map(watcher => watcher()));
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { fork } from 'redux-saga/effects';
|
|
2
|
-
|
|
3
|
-
import application from './application';
|
|
4
|
-
|
|
5
|
-
export default function* saga() {
|
|
6
|
-
yield fork(application);
|
|
7
|
-
}
|
|
1
|
+
import { fork } from 'redux-saga/effects';
|
|
2
|
+
|
|
3
|
+
import application from './application';
|
|
4
|
+
|
|
5
|
+
export default function* saga() {
|
|
6
|
+
yield fork(application);
|
|
7
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const getApplication = state => state.application;
|
|
1
|
+
export const getApplication = state => state.application;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { getApplication } from './application';
|
|
2
|
-
|
|
3
|
-
describe('application selectors', () => {
|
|
4
|
-
const state = {
|
|
5
|
-
application: {
|
|
6
|
-
test: true
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
it('getApplication', () => {
|
|
11
|
-
expect(getApplication(state)).toBe(state.application);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
1
|
+
import { getApplication } from './application';
|
|
2
|
+
|
|
3
|
+
describe('application selectors', () => {
|
|
4
|
+
const state = {
|
|
5
|
+
application: {
|
|
6
|
+
test: true
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
it('getApplication', () => {
|
|
11
|
+
expect(getApplication(state)).toBe(state.application);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<%
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
<% if (flags.addJest) { %>
|
|
2
|
+
import { createElement } from 'react';
|
|
3
|
+
<% } %>
|
|
4
|
+
|
|
5
|
+
<% if (flags.addRedux) { %>
|
|
6
|
+
/* eslint-disable react/display-name, react/prop-types */
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates an object containing action constants namespaced under the specified reducer.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} reducer The name of the reducer or module
|
|
12
|
+
* @param {string[]} actions A list of action names
|
|
13
|
+
* @return {object} Object with action name keys and full action string values
|
|
14
|
+
*/
|
|
15
|
+
export function buildActions(reducer, actions) {
|
|
16
|
+
const result = {};
|
|
17
|
+
|
|
18
|
+
for (const action of actions) {
|
|
19
|
+
result[action] = `${reducer}/${action}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
<% } %>
|
|
25
|
+
|
|
26
|
+
<% if (flags.addJest) { %>
|
|
27
|
+
/**
|
|
28
|
+
* Creates a mock component which will expose its props for snapshot testing purposes.
|
|
29
|
+
*
|
|
30
|
+
* @param {string} name The component/element name (e.g. "MyComponent")
|
|
31
|
+
* @param {object} props An object containing props to setup
|
|
32
|
+
* @return {object} Mock component with specified name and props
|
|
33
|
+
*/
|
|
34
|
+
export const mockComponent = (name, props = {}) => () =>
|
|
35
|
+
createElement(name, props, props.children);
|
|
36
|
+
<% } %>
|
|
@@ -1,109 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
new
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
new
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
}),
|
|
106
|
-
new CssMinimizerPlugin()
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
};
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import HtmlPlugin from 'html-webpack-plugin';
|
|
3
|
+
import ESLintPlugin from 'eslint-webpack-plugin';
|
|
4
|
+
import TerserPlugin from 'terser-webpack-plugin';
|
|
5
|
+
import StylelintPlugin from 'stylelint-webpack-plugin';
|
|
6
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
7
|
+
import { CleanWebpackPlugin as CleanPlugin } from 'clean-webpack-plugin';
|
|
8
|
+
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
9
|
+
|
|
10
|
+
const dev = process.env.NODE_ENV === 'development';
|
|
11
|
+
|
|
12
|
+
const plugins = [
|
|
13
|
+
new CleanPlugin(),
|
|
14
|
+
new StylelintPlugin({
|
|
15
|
+
configFile: '.stylelintrc',
|
|
16
|
+
context: 'src',
|
|
17
|
+
files: '**/*.scss',
|
|
18
|
+
failOnError: true,
|
|
19
|
+
quiet: false,
|
|
20
|
+
customSyntax: 'postcss-scss'
|
|
21
|
+
}),
|
|
22
|
+
new HtmlPlugin({
|
|
23
|
+
template: './src/index.html'
|
|
24
|
+
}),
|
|
25
|
+
new ESLintPlugin(),
|
|
26
|
+
new MiniCssExtractPlugin()
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
mode: dev ? 'development' : 'production',
|
|
31
|
+
devtool: dev ? 'eval-cheap-module-source-map' : 'cheap-module-source-map',
|
|
32
|
+
entry: './src/index.js',
|
|
33
|
+
devServer: {
|
|
34
|
+
compress: dev,
|
|
35
|
+
open: true,
|
|
36
|
+
historyApiFallback: true,
|
|
37
|
+
hot: dev,
|
|
38
|
+
port: 9000
|
|
39
|
+
},
|
|
40
|
+
module: {
|
|
41
|
+
rules: [
|
|
42
|
+
{
|
|
43
|
+
test: /\.js$/,
|
|
44
|
+
exclude: /node_modules/,
|
|
45
|
+
use: ['babel-loader']
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
test: /\.(sa|sc|c)ss$/,
|
|
49
|
+
use: [
|
|
50
|
+
MiniCssExtractPlugin.loader,
|
|
51
|
+
'css-loader',
|
|
52
|
+
{
|
|
53
|
+
loader: 'postcss-loader',
|
|
54
|
+
options: {
|
|
55
|
+
postcssOptions: {
|
|
56
|
+
ident: 'postcss',
|
|
57
|
+
plugins: [
|
|
58
|
+
require('autoprefixer'),
|
|
59
|
+
require('postcss-flexbugs-fixes')
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
sourceMap: dev
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
'sass-loader'
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
test: /\.html$/,
|
|
70
|
+
use: [
|
|
71
|
+
{
|
|
72
|
+
loader: 'html-loader',
|
|
73
|
+
options: { minimize: true }
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
output: {
|
|
80
|
+
path: resolve(__dirname, 'dist'),
|
|
81
|
+
filename: 'main.js',
|
|
82
|
+
chunkFilename: '[name].js'
|
|
83
|
+
},
|
|
84
|
+
plugins,
|
|
85
|
+
resolve: {
|
|
86
|
+
extensions: ['.js', '.json'],
|
|
87
|
+
modules: ['node_modules', 'src'],
|
|
88
|
+
alias: {
|
|
89
|
+
components: resolve(__dirname, 'src/components'),
|
|
90
|
+
utils: resolve(__dirname, 'src/utils')
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
optimization: {
|
|
94
|
+
minimizer: [
|
|
95
|
+
new TerserPlugin({
|
|
96
|
+
terserOptions: {
|
|
97
|
+
ecma: 12
|
|
98
|
+
}
|
|
99
|
+
}),
|
|
100
|
+
new CssMinimizerPlugin()
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
};
|