Skip to content

Commit c1dc3c5

Browse files
author
Jovert Lota Palonpon
committed
Added support for dynamic imports
1 parent 625a9cd commit c1dc3c5

File tree

5 files changed

+65
-5
lines changed

5 files changed

+65
-5
lines changed

.babelrc

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"presets": ["@babel/preset-env", "@babel/preset-react"],
33
"plugins": [
4+
"@babel/plugin-syntax-dynamic-import",
45
"@babel/plugin-proposal-class-properties",
56
"@babel/plugin-transform-runtime"
67
]

.eslintrc

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
"es6": true
77
},
88
"extends": "eslint:recommended",
9+
"parser": "babel-eslint",
910
"parserOptions": {
1011
"ecmaFeatures": {
1112
"jsx": true
1213
},
1314
"ecmaVersion": 2017,
14-
"sourceType": "module"
15+
"sourceType": "module",
16+
"allowImportExportEverywhere": true
1517
},
1618
"plugins": ["react"],
1719
"rules": {
18-
"indent": ["warn", 4],
20+
"indent": ["warn", "4"],
1921
"linebreak-style": ["warn", "unix"],
2022
"quotes": ["warn", "single"],
2123
"semi": ["warn", "always"],

package-lock.json

+55-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"dependencies": {
1414
"@babel/runtime": "^7.3.1",
1515
"@date-io/moment": "^1.1.0",
16+
"@loadable/component": "^5.7.0",
1617
"@material-ui/core": "^3.9.2",
1718
"@material-ui/icons": "^3.0.2",
1819
"@material-ui/lab": "^3.0.0-alpha.30",
@@ -32,9 +33,11 @@
3233
"devDependencies": {
3334
"@babel/core": "^7.2.2",
3435
"@babel/plugin-proposal-class-properties": "^7.3.0",
36+
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
3537
"@babel/plugin-transform-runtime": "^7.2.0",
3638
"@babel/preset-env": "^7.3.1",
3739
"@babel/preset-react": "^7.0.0",
40+
"babel-eslint": "^10.0.1",
3841
"babel-loader": "^8.0.5",
3942
"browser-sync": "^2.26.3",
4043
"browser-sync-webpack-plugin": "^2.2.2",

webpack.config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
1313
module.exports = env => {
1414
// Globals
1515
const inProduction = env.NODE_ENV === 'production';
16-
const PUBLIC_DIR = path.resolve(__dirname, './public');
16+
const PUBLIC_DIR = '/';
1717
const SRC_DIR = path.resolve(__dirname, './resources/js');
1818
const DIST_DIR = path.resolve(__dirname, './public');
1919

@@ -133,6 +133,7 @@ module.exports = env => {
133133
path: DIST_DIR,
134134
publicPath: PUBLIC_DIR,
135135
filename: 'js/[name].bundle.[contenthash].js',
136+
chunkFilename: 'js/[name].bundle.[contenthash].js',
136137
},
137138

138139
optimization: {

0 commit comments

Comments
 (0)