Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit 9271625

Browse files
author
george
committed
Merge branch 'develop'
2 parents 38980c9 + acb1fa2 commit 9271625

File tree

12 files changed

+76
-49
lines changed

12 files changed

+76
-49
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = api => {
1616
plugins = [
1717
...plugins,
1818
"dynamic-import-node",
19-
["babel-plugin-webpack-aliases", { config: "config/webpack.dev.js" }],
19+
["babel-plugin-webpack-aliases", { config: "webpack.dev.js" }],
2020
]
2121
} else if (cjs || rollup) {
2222
presets = ["@babel/preset-env"]
File renamed without changes.

jest.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
clearMocks: true,
3+
restoreMocks: true,
4+
moduleNameMapper: {
5+
"\\.(css|scss)$": "<rootDir>/test/__mocks__/emptyMock.js",
6+
"\\.(jpg|jpeg|png|gif|md|eot|otf|webp|svg|ttf|woff|woff2)$":
7+
"<rootDir>/test/__mocks__/emptyMock.js",
8+
"^projectRoot/(.*?)$": "<rootDir>/$1",
9+
"^routes/(.*?)$": "<rootDir>/app/routes/$1",
10+
"^components/(.*?)$": "<rootDir>/app/components/$1",
11+
"^helpers/(.*?)$": "<rootDir>/app/helpers/$1",
12+
"^pages/(.*?)$": "<rootDir>/app/pages/$1",
13+
"^assets/(.*?)$": "<rootDir>/app/assets/$1",
14+
"^docs/(.*?)$": "<rootDir>/app/docs/$1",
15+
"^undernet/(.*?)$": "<rootDir>/js/esm/$1",
16+
},
17+
roots: ["<rootDir>/app/", "<rootDir>/js/"],
18+
setupFiles: ["<rootDir>/test/jest.setup.js"],
19+
snapshotSerializers: ["enzyme-to-json/serializer"],
20+
testMatch: ["<rootDir>/app/**/*.spec.js", "<rootDir>/js/**/*.spec.js"],
21+
testURL: "http://localhost/",
22+
transform: {
23+
"^.+\\.js$": "babel-jest",
24+
},
25+
unmockedModulePathPatterns: ["node_modules/react/", "node_modules/enzyme/"],
26+
verbose: false,
27+
}

package.json

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"sass": "scss/undernet.scss",
1212
"style": "dist/undernet.css",
1313
"scripts": {
14-
"watch": "yarn js:build && webpack-dev-server --config config/webpack.dev.js --progress --open",
15-
"build": "yarn js:build && webpack --config config/webpack.prod.js --progress",
14+
"watch": "yarn js:build && webpack-dev-server --config webpack.dev.js --progress",
15+
"build": "yarn js:build && webpack --config webpack.prod.js --progress",
1616
"test": "jest",
1717
"test:watch": "jest --watch",
1818
"lint": "eslint . --ext .js -c ./.eslintrc.js --ignore-path .eslintignore; exit 0",
@@ -25,7 +25,7 @@
2525
"js:build:esm": "BABEL_ENV=esm babel js/src/ -d js/esm/ --ignore 'js/src/index.bundle.js' --no-comments -s",
2626
"js:watch": "BABEL_ENV=esm babel js/src/ -d js/esm/ --watch --no-comments -s",
2727
"js:prettify": "prettier --write 'js/src/**/*.js'",
28-
"js:rollup": "BABEL_ENV=rollup rollup -c config/rollup.config.js",
28+
"js:rollup": "BABEL_ENV=rollup rollup -c",
2929
"js:modules:zip": "cd js/src/ && zip -r ../../dist/undernet.modules.js.zip .",
3030
"js:zip": "cd dist/ && zip -r undernet.js.zip . -x *.css *.zip *.css.map",
3131
"js:prepublish": "yarn js:build && yarn js:rollup && yarn js:modules:zip && yarn js:zip",
@@ -98,6 +98,7 @@
9898
"rollup-plugin-uglify": "^6.0.2",
9999
"sass-loader": "^7.1.0",
100100
"style-loader": "^0.23.1",
101+
"terser-webpack-plugin": "^1.3.0",
101102
"uglify-js": "^3.6.0",
102103
"uglifyjs-webpack-plugin": "^2.1.2",
103104
"webpack": "^4.35.0",
@@ -130,44 +131,5 @@
130131
},
131132
"bugs": {
132133
"url": "https://github.com/geotrev/undernet/issues"
133-
},
134-
"jest": {
135-
"clearMocks": true,
136-
"restoreMocks": true,
137-
"moduleNameMapper": {
138-
"\\.(css|scss)$": "<rootDir>/config/__mocks__/emptyMock.js",
139-
"\\.(jpg|jpeg|png|gif|md|eot|otf|webp|svg|ttf|woff|woff2)$": "<rootDir>/config/__mocks__/emptyMock.js",
140-
"^projectRoot/(.*?)$": "<rootDir>/$1",
141-
"^routes/(.*?)$": "<rootDir>/app/routes/$1",
142-
"^components/(.*?)$": "<rootDir>/app/components/$1",
143-
"^helpers/(.*?)$": "<rootDir>/app/helpers/$1",
144-
"^pages/(.*?)$": "<rootDir>/app/pages/$1",
145-
"^assets/(.*?)$": "<rootDir>/app/assets/$1",
146-
"^docs/(.*?)$": "<rootDir>/app/docs/$1",
147-
"^undernet/(.*?)$": "<rootDir>/js/esm/$1"
148-
},
149-
"roots": [
150-
"<rootDir>/app/",
151-
"<rootDir>/js/"
152-
],
153-
"setupFiles": [
154-
"<rootDir>/config/jest.config.js"
155-
],
156-
"snapshotSerializers": [
157-
"enzyme-to-json/serializer"
158-
],
159-
"testMatch": [
160-
"<rootDir>/app/**/*.spec.js",
161-
"<rootDir>/js/**/*.spec.js"
162-
],
163-
"testURL": "http://localhost/",
164-
"transform": {
165-
"^.+\\.js$": "babel-jest"
166-
},
167-
"unmockedModulePathPatterns": [
168-
"node_modules/react/",
169-
"node_modules/enzyme/"
170-
],
171-
"verbose": false
172134
}
173135
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { uglify } from "rollup-plugin-uglify"
2-
import pkg from "../package.json"
32
import path from "path"
43
import resolve from "rollup-plugin-node-resolve"
54
import babel from "rollup-plugin-babel"
6-
import banner from "./banner"
5+
import banner from "./bin/banner"
6+
import pkg from "./package.json"
77

88
// Base configurations for all bundles
99

webpack.common.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module.exports = {
6969
}),
7070
new MiniCssExtractPlugin({
7171
filename: "[name].[chunkhash].css",
72+
chunkFilename: "[name].[chunkhash].css",
7273
}),
7374
new CopyWebpackPlugin([
7475
{
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const merge = require("webpack-merge")
2-
const common = require("../webpack.common.js")
2+
const common = require("./webpack.common.js")
33

44
module.exports = merge(common, {
55
devtool: "source-map",
@@ -8,6 +8,7 @@ module.exports = merge(common, {
88
publicPath: "/",
99
historyApiFallback: true,
1010
port: 3000,
11+
open: true,
1112
},
1213
mode: "development",
1314
})

0 commit comments

Comments
 (0)