Convert to using frontend-build. (#118)
Goodbye dependencies! Goodbye config!
This commit is contained in:
41
.babelrc
41
.babelrc
@@ -1,41 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"env",
|
||||
{
|
||||
"targets": {
|
||||
"browsers": ["last 2 versions", "ie 11"]
|
||||
}
|
||||
}
|
||||
],
|
||||
"babel-preset-react"
|
||||
],
|
||||
"plugins": [
|
||||
"transform-object-rest-spread",
|
||||
"transform-class-properties",
|
||||
["transform-imports", {
|
||||
"@fortawesome/free-brands-svg-icons": {
|
||||
"transform": "@fortawesome/free-brands-svg-icons/${member}",
|
||||
"skipDefaultConversion": true
|
||||
},
|
||||
"@fortawesome/free-regular-svg-icons": {
|
||||
"transform": "@fortawesome/free-regular-svg-icons/${member}",
|
||||
"skipDefaultConversion": true
|
||||
},
|
||||
"@fortawesome/free-solid-svg-icons": {
|
||||
"transform": "@fortawesome/free-solid-svg-icons/${member}",
|
||||
"skipDefaultConversion": true
|
||||
}
|
||||
}]
|
||||
],
|
||||
"env": {
|
||||
"i18n": {
|
||||
"plugins": [
|
||||
["react-intl", {
|
||||
"messagesDir": "./temp/babel-plugin-react-intl",
|
||||
"moduleSourceName": "@edx/frontend-i18n"
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
32
.env
Normal file
32
.env
Normal file
@@ -0,0 +1,32 @@
|
||||
NODE_ENV=null
|
||||
ACCESS_TOKEN_COOKIE_NAME=null
|
||||
BASE_URL=null
|
||||
CREDENTIALS_BASE_URL=null
|
||||
CSRF_TOKEN_API_PATH=null
|
||||
ECOMMERCE_BASE_URL=null
|
||||
LANGUAGE_PREFERENCE_COOKIE_NAME=null
|
||||
LMS_BASE_URL=null
|
||||
LOGIN_URL=null
|
||||
LOGOUT_URL=null
|
||||
MARKETING_SITE_BASE_URL=null
|
||||
ORDER_HISTORY_URL=null
|
||||
REFRESH_ACCESS_TOKEN_ENDPOINT=null
|
||||
SEGMENT_KEY=null
|
||||
SITE_NAME=null
|
||||
USER_INFO_COOKIE_NAME=null
|
||||
APPLE_APP_STORE_URL=null
|
||||
CONTACT_URL=null
|
||||
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM=null
|
||||
ENTERPRISE_MARKETING_URL=null
|
||||
ENTERPRISE_MARKETING_UTM_CAMPAIGN=null
|
||||
ENTERPRISE_MARKETING_UTM_SOURCE=null
|
||||
FACEBOOK_URL=null
|
||||
GOOGLE_PLAY_URL=null
|
||||
LINKED_IN_URL=null
|
||||
OPEN_SOURCE_URL=null
|
||||
PRIVACY_POLICY_URL=null
|
||||
REDDIT_URL=null
|
||||
SUPPORT_URL=null
|
||||
TERMS_OF_SERVICE_URL=null
|
||||
TWITTER_URL=null
|
||||
YOU_TUBE_URL=null
|
||||
33
.env.development
Normal file
33
.env.development
Normal file
@@ -0,0 +1,33 @@
|
||||
NODE_ENV='development'
|
||||
PORT=1997
|
||||
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
|
||||
BASE_URL='localhost:1997'
|
||||
CREDENTIALS_BASE_URL='http://localhost:18150'
|
||||
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
|
||||
ECOMMERCE_BASE_URL='http://localhost:18130'
|
||||
LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
|
||||
LMS_BASE_URL='http://localhost:18000'
|
||||
LOGIN_URL='http://localhost:18000/login'
|
||||
LOGOUT_URL='http://localhost:18000/login'
|
||||
MARKETING_SITE_BASE_URL='http://localhost:18000'
|
||||
ORDER_HISTORY_URL='localhost:1996/orders'
|
||||
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
||||
SEGMENT_KEY=null
|
||||
SITE_NAME='edX'
|
||||
USER_INFO_COOKIE_NAME='edx-user-info'
|
||||
APPLE_APP_STORE_URL='https://www.apple.com/ios/app-store/'
|
||||
CONTACT_URL='http://localhost:18000/contact'
|
||||
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM='Footer'
|
||||
ENTERPRISE_MARKETING_URL='http://example.com'
|
||||
ENTERPRISE_MARKETING_UTM_CAMPAIGN='my_campaign'
|
||||
ENTERPRISE_MARKETING_UTM_SOURCE='edX profile'
|
||||
FACEBOOK_URL='https://www.facebook.com'
|
||||
GOOGLE_PLAY_URL='https://play.google.com/store'
|
||||
LINKED_IN_URL='https://www.linkedin.com'
|
||||
OPEN_SOURCE_URL='http://localhost:18000/openedx'
|
||||
PRIVACY_POLICY_URL='http://localhost:18000/privacy-policy'
|
||||
REDDIT_URL='https://www.reddit.com'
|
||||
SUPPORT_URL='http://localhost:18000/support'
|
||||
TERMS_OF_SERVICE_URL='http://localhost:18000/terms-of-service'
|
||||
TWITTER_URL='https://twitter.com'
|
||||
YOU_TUBE_URL='https://www.youtube.com'
|
||||
15
.env.test
Normal file
15
.env.test
Normal file
@@ -0,0 +1,15 @@
|
||||
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
|
||||
BASE_URL='localhost:1997'
|
||||
CREDENTIALS_BASE_URL='http://localhost:18150'
|
||||
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
|
||||
ECOMMERCE_BASE_URL='http://localhost:18130'
|
||||
LANGUAGE_PREFERENCE_COOKIE_NAME='openedx-language-preference'
|
||||
LMS_BASE_URL='http://localhost:18000'
|
||||
LOGIN_URL='http://localhost:18000/login'
|
||||
LOGOUT_URL='http://localhost:18000/login'
|
||||
MARKETING_SITE_BASE_URL='http://localhost:18000'
|
||||
ORDER_HISTORY_URL='localhost:1996/orders'
|
||||
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
|
||||
SEGMENT_KEY=null
|
||||
SITE_NAME='edX'
|
||||
USER_INFO_COOKIE_NAME='edx-user-info'
|
||||
@@ -2,3 +2,4 @@ coverage/*
|
||||
dist/
|
||||
node_modules/
|
||||
__mocks__/
|
||||
__snapshots__/
|
||||
|
||||
34
.eslintrc
34
.eslintrc
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"extends": "eslint-config-edx",
|
||||
"parser": "babel-eslint",
|
||||
"rules": {
|
||||
"import/no-extraneous-dependencies": [
|
||||
"error",
|
||||
{
|
||||
"devDependencies": [
|
||||
"webpack/*.js",
|
||||
"**/*.test.jsx",
|
||||
"**/*.test.js"
|
||||
]
|
||||
}
|
||||
],
|
||||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/340#issuecomment-338424908
|
||||
"jsx-a11y/anchor-is-valid": [ "error", {
|
||||
"components": [ "Link" ],
|
||||
"specialLink": [ "to" ]
|
||||
}],
|
||||
"jsx-a11y/label-has-for": [ 2, {
|
||||
"components": [ "label" ],
|
||||
"required": {
|
||||
"some": [ "nesting", "id" ]
|
||||
},
|
||||
"allowChildren": false
|
||||
}]
|
||||
},
|
||||
"env": {
|
||||
"jest": true
|
||||
},
|
||||
"globals": {
|
||||
"newrelic": false
|
||||
}
|
||||
}
|
||||
3
.eslintrc.js
Executable file
3
.eslintrc.js
Executable file
@@ -0,0 +1,3 @@
|
||||
const { createConfig } = require('@edx/frontend-build');
|
||||
|
||||
module.exports = createConfig('eslint');
|
||||
22
.npmignore
22
.npmignore
@@ -1,13 +1,15 @@
|
||||
.eslintignore
|
||||
.eslintrc.json
|
||||
.gitignore
|
||||
.travis.yml
|
||||
docker-compose.yml
|
||||
Dockerfile
|
||||
Makefile
|
||||
npm-debug.log
|
||||
|
||||
webpack
|
||||
.tx
|
||||
coverage
|
||||
dist
|
||||
node_modules
|
||||
public
|
||||
src
|
||||
.dockerignore
|
||||
.eslintignore
|
||||
.eslintrc
|
||||
.gitignore
|
||||
.releaserc
|
||||
.travis.yml
|
||||
babel.config.js
|
||||
Makefile
|
||||
renovate.json
|
||||
7
jest.config.js
Normal file
7
jest.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const { createConfig } = require('@edx/frontend-build');
|
||||
|
||||
module.exports = createConfig('jest', {
|
||||
setupFiles: [
|
||||
'<rootDir>/src/setupTest.js',
|
||||
],
|
||||
});
|
||||
15092
package-lock.json
generated
15092
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
156
package.json
156
package.json
@@ -1,36 +1,41 @@
|
||||
{
|
||||
"name": "@edx/frontend-app-account",
|
||||
"version": "0.1.0",
|
||||
"description": "User account React app",
|
||||
"version": "1.0.0-semantically-released",
|
||||
"description": "User account micro-frontend for Open edX",
|
||||
"author": "edX",
|
||||
"license": "AGPL-3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/edx/frontend-app-account.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "NODE_ENV=production BABEL_ENV=production webpack --config=webpack/webpack.prod.config.js",
|
||||
"i18n_extract": "BABEL_ENV=i18n babel src --quiet > /dev/null",
|
||||
"build": "fedx-scripts webpack",
|
||||
"i18n_extract": "BABEL_ENV=i18n fedx-scripts babel src --quiet > /dev/null",
|
||||
"is-es5": "es-check es5 ./dist/*.js",
|
||||
"lint": "eslint --ext .js --ext .jsx .",
|
||||
"precommit": "npm run lint",
|
||||
"start": "NODE_ENV=development BABEL_ENV=development webpack-dev-server --config=webpack/webpack.dev.config.js --progress",
|
||||
"test": "jest --coverage --passWithNoTests"
|
||||
"lint": "fedx-scripts eslint",
|
||||
"snapshot": "fedx-scripts jest --updateSnapshot",
|
||||
"start": "fedx-scripts webpack-dev-server --progress",
|
||||
"test": "fedx-scripts jest --coverage --passWithNoTests"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/edx/frontend-app-account/issues"
|
||||
},
|
||||
"author": "edX",
|
||||
"license": "AGPL-3.0",
|
||||
"homepage": "https://github.com/edx/frontend-app-account#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 2 versions",
|
||||
"ie 11"
|
||||
],
|
||||
"dependencies": {
|
||||
"@cospired/i18n-iso-languages": "^2.0.2",
|
||||
"@edx/edx-bootstrap": "^2.2.1",
|
||||
"@edx/frontend-analytics": "^2.0.0",
|
||||
"@edx/frontend-auth": "^5.3.5",
|
||||
"@edx/frontend-component-footer": "^6.0.2",
|
||||
"@edx/frontend-component-site-header": "^2.4.0",
|
||||
"@edx/frontend-i18n": "^2.1.0",
|
||||
"@edx/frontend-logging": "^2.0.2",
|
||||
"@edx/paragon": "^4.2.6",
|
||||
"@edx/paragon": "^7.1.5",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.18",
|
||||
"@fortawesome/free-brands-svg-icons": "^5.8.2",
|
||||
"@fortawesome/free-regular-svg-icons": "^5.7.1",
|
||||
@@ -38,15 +43,11 @@
|
||||
"@fortawesome/react-fontawesome": "^0.1.4",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"classnames": "^2.2.6",
|
||||
"connected-react-router": "^5.0.1",
|
||||
"email-prop-type": "^1.1.5",
|
||||
"connected-react-router": "^6.5.2",
|
||||
"font-awesome": "^4.7.0",
|
||||
"form-urlencoded": "^3.0.0",
|
||||
"formdata-polyfill": "^3.0.18",
|
||||
"glob": "^7.1.3",
|
||||
"history": "^4.7.2",
|
||||
"i18n-iso-countries": "^3.7.8",
|
||||
"iso-countries-languages": "^0.2.1",
|
||||
"form-urlencoded": "^4.0.1",
|
||||
"formdata-polyfill": "^3.0.19",
|
||||
"history": "^4.10.1",
|
||||
"lodash.camelcase": "^4.3.0",
|
||||
"lodash.findindex": "^4.6.0",
|
||||
"lodash.get": "^4.4.2",
|
||||
@@ -54,98 +55,37 @@
|
||||
"lodash.omit": "^4.5.0",
|
||||
"lodash.pick": "^4.4.0",
|
||||
"lodash.snakecase": "^4.1.1",
|
||||
"memoize-one": "^5.0.4",
|
||||
"newrelic": "^5.5.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": "^16.8.3",
|
||||
"react-dom": "^16.8.3",
|
||||
"react-redux": "^5.1.1",
|
||||
"react-router": "^4.2.0",
|
||||
"react-router-dom": "^4.2.2",
|
||||
"react-router-hash-link": "^1.2.1",
|
||||
"memoize-one": "^5.1.1",
|
||||
"newrelic": "^5.13.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^16.10.2",
|
||||
"react-dom": "^16.10.2",
|
||||
"react-redux": "^7.1.1",
|
||||
"react-router": "^5.1.2",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"react-router-hash-link": "^1.2.2",
|
||||
"react-scrollspy": "^3.4.0",
|
||||
"react-transition-group": "^2.5.3",
|
||||
"redux": "^4.0.1",
|
||||
"redux-devtools-extension": "^2.13.2",
|
||||
"react-transition-group": "^4.3.0",
|
||||
"redux": "^4.0.4",
|
||||
"redux-devtools-extension": "^2.13.8",
|
||||
"redux-logger": "^3.0.6",
|
||||
"redux-saga": "^1.0.1",
|
||||
"redux-thunk": "^2.2.0",
|
||||
"redux-saga": "^1.1.1",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"reselect": "^4.0.0",
|
||||
"universal-cookie": "^3.1.0",
|
||||
"url-polyfill": "^1.1.5"
|
||||
"universal-cookie": "^4.0.2",
|
||||
"url-polyfill": "^1.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@svgr/webpack": "^4.2.0",
|
||||
"autoprefixer": "^9.4.2",
|
||||
"axios-mock-adapter": "^1.15.0",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-eslint": "^8.2.2",
|
||||
"babel-jest": "^22.4.0",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-react-intl": "^3.0.1",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-imports": "^1.5.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-preset-react": "^6.24.1",
|
||||
"clean-webpack-plugin": "^0.1.19",
|
||||
"codecov": "^3.0.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"css-loader": "^0.28.9",
|
||||
"enzyme": "^3.3.0",
|
||||
"enzyme-adapter-react-16": "^1.1.1",
|
||||
"@edx/frontend-build": "^1.2.2",
|
||||
"codecov": "^3.6.1",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.15.1",
|
||||
"es-check": "^5.0.0",
|
||||
"eslint-config-edx": "^4.0.3",
|
||||
"fetch-mock": "^6.3.0",
|
||||
"file-loader": "^1.1.9",
|
||||
"html-webpack-harddisk-plugin": "^0.2.0",
|
||||
"html-webpack-new-relic-plugin": "^1.1.0",
|
||||
"html-webpack-plugin": "^3.0.3",
|
||||
"husky": "^0.14.3",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"image-webpack-loader": "^4.2.0",
|
||||
"jest": "^22.4.0",
|
||||
"mini-css-extract-plugin": "^0.4.0",
|
||||
"new-relic-source-map-webpack-plugin": "1.1.0",
|
||||
"node-sass": "^4.12.0",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"postcss-rtl": "^1.3.3",
|
||||
"purgecss-webpack-plugin": "^1.5.0",
|
||||
"react-dev-utils": "^5.0.0",
|
||||
"react-test-renderer": "^16.8.6",
|
||||
"reactifex": "1.1.1",
|
||||
"redux-mock-store": "^1.5.3",
|
||||
"sass-loader": "^6.0.6",
|
||||
"source-map-loader": "^0.2.4",
|
||||
"style-loader": "^0.20.2",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack": "^4.25.1",
|
||||
"webpack-bundle-analyzer": "^3.3.2",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-dev-server": "^3.1.0",
|
||||
"webpack-merge": "^4.1.1"
|
||||
},
|
||||
"jest": {
|
||||
"testURL": "http://localhost/",
|
||||
"setupFiles": [
|
||||
"./src/setupTest.js"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"\\.svg": "<rootDir>/__mocks__/svgrMock.js",
|
||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
|
||||
"\\.(css|scss)$": "identity-obj-proxy"
|
||||
},
|
||||
"collectCoverageFrom": [
|
||||
"src/**/*.{js,jsx}"
|
||||
],
|
||||
"coveragePathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"src/setupTest.js",
|
||||
"src/index.js",
|
||||
"/tests/"
|
||||
],
|
||||
"transformIgnorePatterns": [
|
||||
"/node_modules/(?!(@edx/paragon)/).*/"
|
||||
]
|
||||
"glob": "^7.1.4",
|
||||
"husky": "^3.0.9",
|
||||
"purgecss-webpack-plugin": "^1.6.0",
|
||||
"react-test-renderer": "^16.8.3",
|
||||
"reactifex": "^1.1.1",
|
||||
"redux-mock-store": "^1.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
5
renovate.json
Normal file
5
renovate.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
]
|
||||
}
|
||||
@@ -8,11 +8,11 @@ exports[`ConfirmationModal should match default closed confirmation modal snapsh
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click fade"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="id3"
|
||||
aria-labelledby="id2"
|
||||
aria-modal={true}
|
||||
className=""
|
||||
role="dialog"
|
||||
@@ -26,7 +26,7 @@ exports[`ConfirmationModal should match default closed confirmation modal snapsh
|
||||
>
|
||||
<h2
|
||||
className="modal-title"
|
||||
id="id3"
|
||||
id="id2"
|
||||
>
|
||||
Are you sure?
|
||||
</h2>
|
||||
@@ -120,6 +120,7 @@ exports[`ConfirmationModal should match default closed confirmation modal snapsh
|
||||
</button>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton1"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
@@ -142,11 +143,11 @@ exports[`ConfirmationModal should match empty password confirmation modal snapsh
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click show d-block"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="id5"
|
||||
aria-labelledby="id6"
|
||||
aria-modal={true}
|
||||
className="modal-dialog"
|
||||
role="dialog"
|
||||
@@ -160,7 +161,7 @@ exports[`ConfirmationModal should match empty password confirmation modal snapsh
|
||||
>
|
||||
<h2
|
||||
className="modal-title"
|
||||
id="id5"
|
||||
id="id6"
|
||||
>
|
||||
Are you sure?
|
||||
</h2>
|
||||
@@ -287,6 +288,7 @@ exports[`ConfirmationModal should match empty password confirmation modal snapsh
|
||||
</button>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton5"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
@@ -309,7 +311,7 @@ exports[`ConfirmationModal should match open confirmation modal snapshot 1`] = `
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click show d-block"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
@@ -421,6 +423,7 @@ exports[`ConfirmationModal should match open confirmation modal snapshot 1`] = `
|
||||
</button>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton3"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
|
||||
@@ -8,11 +8,11 @@ exports[`SuccessModal should match default closed success modal snapshot 1`] = `
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click fade"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="id3"
|
||||
aria-labelledby="id2"
|
||||
aria-modal={true}
|
||||
className=""
|
||||
role="dialog"
|
||||
@@ -26,7 +26,7 @@ exports[`SuccessModal should match default closed success modal snapshot 1`] = `
|
||||
>
|
||||
<h2
|
||||
className="modal-title"
|
||||
id="id3"
|
||||
id="id2"
|
||||
>
|
||||
We're sorry to see you go! Your account will be deleted shortly.
|
||||
</h2>
|
||||
@@ -47,6 +47,7 @@ exports[`SuccessModal should match default closed success modal snapshot 1`] = `
|
||||
>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton1"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
@@ -69,7 +70,7 @@ exports[`SuccessModal should match default closed success modal snapshot 2`] = `
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click fade"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
@@ -108,6 +109,7 @@ exports[`SuccessModal should match default closed success modal snapshot 2`] = `
|
||||
>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton3"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
@@ -130,68 +132,7 @@ exports[`SuccessModal should match default closed success modal snapshot 3`] = `
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click fade"
|
||||
onClick={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="id5"
|
||||
aria-modal={true}
|
||||
className=""
|
||||
role="dialog"
|
||||
tabIndex="-1"
|
||||
>
|
||||
<div
|
||||
className="modal-content"
|
||||
>
|
||||
<div
|
||||
className="modal-header"
|
||||
>
|
||||
<h2
|
||||
className="modal-title"
|
||||
id="id5"
|
||||
>
|
||||
We're sorry to see you go! Your account will be deleted shortly.
|
||||
</h2>
|
||||
</div>
|
||||
<div
|
||||
className="modal-body"
|
||||
>
|
||||
<div>
|
||||
<p
|
||||
className="h6"
|
||||
>
|
||||
Account deletion, including removal from email lists, may take a few weeks to fully process through our system. If you want to opt-out of emails before then, please unsubscribe from the footer of any email.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="modal-footer"
|
||||
>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
type="button"
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`SuccessModal should match default closed success modal snapshot 4`] = `
|
||||
<div>
|
||||
<div
|
||||
className="fade"
|
||||
role="presentation"
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click fade"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
@@ -230,6 +171,69 @@ exports[`SuccessModal should match default closed success modal snapshot 4`] = `
|
||||
>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton5"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
type="button"
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`SuccessModal should match default closed success modal snapshot 4`] = `
|
||||
<div>
|
||||
<div
|
||||
className="fade"
|
||||
role="presentation"
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click fade"
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="id8"
|
||||
aria-modal={true}
|
||||
className=""
|
||||
role="dialog"
|
||||
tabIndex="-1"
|
||||
>
|
||||
<div
|
||||
className="modal-content"
|
||||
>
|
||||
<div
|
||||
className="modal-header"
|
||||
>
|
||||
<h2
|
||||
className="modal-title"
|
||||
id="id8"
|
||||
>
|
||||
We're sorry to see you go! Your account will be deleted shortly.
|
||||
</h2>
|
||||
</div>
|
||||
<div
|
||||
className="modal-body"
|
||||
>
|
||||
<div>
|
||||
<p
|
||||
className="h6"
|
||||
>
|
||||
Account deletion, including removal from email lists, may take a few weeks to fully process through our system. If you want to opt-out of emails before then, please unsubscribe from the footer of any email.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="modal-footer"
|
||||
>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton7"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
@@ -252,11 +256,11 @@ exports[`SuccessModal should match open success modal snapshot 1`] = `
|
||||
/>
|
||||
<div
|
||||
className="modal js-close-modal-on-click show d-block"
|
||||
onClick={[Function]}
|
||||
onMouseDown={[Function]}
|
||||
role="presentation"
|
||||
>
|
||||
<div
|
||||
aria-labelledby="id7"
|
||||
aria-labelledby="id10"
|
||||
aria-modal={true}
|
||||
className="modal-dialog"
|
||||
role="dialog"
|
||||
@@ -270,7 +274,7 @@ exports[`SuccessModal should match open success modal snapshot 1`] = `
|
||||
>
|
||||
<h2
|
||||
className="modal-title"
|
||||
id="id7"
|
||||
id="id10"
|
||||
>
|
||||
We're sorry to see you go! Your account will be deleted shortly.
|
||||
</h2>
|
||||
@@ -291,6 +295,7 @@ exports[`SuccessModal should match open success modal snapshot 1`] = `
|
||||
>
|
||||
<button
|
||||
className="btn js-close-modal-on-click btn-secondary"
|
||||
id="paragonCloseModalButton9"
|
||||
onBlur={[Function]}
|
||||
onClick={[Function]}
|
||||
onKeyDown={[Function]}
|
||||
|
||||
@@ -151,8 +151,8 @@ const reducer = (state = defaultState, action) => {
|
||||
countryTimeZones: action.payload.timeZones,
|
||||
};
|
||||
|
||||
// TODO: Once all the above cases have been converted into sub-reducers, we can use
|
||||
// combineReducers in this file to greatly simplify it.
|
||||
// TODO: Once all the above cases have been converted into sub-reducers, we can use
|
||||
// combineReducers in this file to greatly simplify it.
|
||||
|
||||
// Delete My Account
|
||||
case DELETE_ACCOUNT.CONFIRMATION:
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@import "~@edx/edx-bootstrap/scss/edx/theme.scss";
|
||||
@import '~@edx/paragon/scss/edx/theme.scss';
|
||||
@import '~@edx/paragon/scss/edx/fonts.scss'; // Roboto
|
||||
|
||||
$fa-font-path: "~font-awesome/fonts";
|
||||
@import "~font-awesome/scss/font-awesome";
|
||||
|
||||
@import "~@edx/paragon/src/index.scss";
|
||||
@import "~@edx/frontend-component-site-header/src/index";
|
||||
@import "~@edx/frontend-component-footer/src/lib/scss/site-footer";
|
||||
|
||||
|
||||
21
webpack.prod.config.js
Normal file
21
webpack.prod.config.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const glob = require('glob');
|
||||
const PurgecssPlugin = require('purgecss-webpack-plugin');
|
||||
const { createConfig } = require('@edx/frontend-build');
|
||||
|
||||
module.exports = createConfig('webpack-prod', {
|
||||
plugins: [
|
||||
// Scan files for class names and ids and remove unused css
|
||||
new PurgecssPlugin({
|
||||
paths: [].concat(
|
||||
// Scan files in this app
|
||||
glob.sync('src/**/*', { nodir: true }),
|
||||
// Scan files in any edx frontend-component
|
||||
glob.sync('node_modules/@edx/frontend-component*/**/*', { nodir: true }),
|
||||
// Scan files in paragon
|
||||
glob.sync('node_modules/@edx/paragon/**/*', { nodir: true }),
|
||||
),
|
||||
// Protect react-css-transition class names
|
||||
whitelistPatterns: [/-enter/, /-appear/, /-exit/],
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -1,16 +0,0 @@
|
||||
// This is the common Webpack config. The dev and prod Webpack configs both
|
||||
// inherit config defined here.
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
app: path.resolve(__dirname, '../src/index.jsx'),
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../dist'),
|
||||
publicPath: '/',
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx'],
|
||||
},
|
||||
};
|
||||
@@ -1,167 +0,0 @@
|
||||
// This is the dev Webpack config. All settings here should prefer a fast build
|
||||
// time at the expense of creating larger, unoptimized bundles.
|
||||
|
||||
const Merge = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const webpack = require('webpack');
|
||||
const PostCssRtlPlugin = require('postcss-rtl');
|
||||
|
||||
const commonConfig = require('./webpack.common.config.js');
|
||||
|
||||
module.exports = Merge.smart(commonConfig, {
|
||||
mode: 'development',
|
||||
devtool: 'eval-source-map',
|
||||
entry: {
|
||||
// enable react's custom hot dev client so we get errors reported in the browser
|
||||
hot: require.resolve('react-dev-utils/webpackHotDevClient'),
|
||||
app: path.resolve(__dirname, '../src/index.jsx'),
|
||||
},
|
||||
module: {
|
||||
// Specify file-by-file rules to Webpack. Some file-types need a particular kind of loader.
|
||||
rules: [
|
||||
// The babel-loader transforms newer ES2015+ syntax to older ES5 for older browsers.
|
||||
// Babel is configured with the .babelrc file at the root of the project.
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
include: [
|
||||
path.resolve(__dirname, '../src'),
|
||||
],
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
// Caches result of loader to the filesystem. Future builds will attempt to read from the
|
||||
// cache to avoid needing to run the expensive recompilation process on each run.
|
||||
cacheDirectory: true,
|
||||
},
|
||||
},
|
||||
// We are not extracting CSS from the javascript bundles in development because extracting
|
||||
// prevents hot-reloading from working, it increases build time, and we don't care about
|
||||
// flash-of-unstyled-content issues in development.
|
||||
{
|
||||
test: /(.scss|.css)$/,
|
||||
use: [
|
||||
'style-loader', // creates style nodes from JS strings
|
||||
{
|
||||
loader: 'css-loader', // translates CSS into CommonJS
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
plugins: () => [PostCssRtlPlugin()],
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader', // compiles Sass to CSS
|
||||
options: {
|
||||
sourceMap: true,
|
||||
includePaths: [
|
||||
path.join(__dirname, '../node_modules'),
|
||||
path.join(__dirname, '../src'),
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /.svg$/,
|
||||
issuer: {
|
||||
test: /\.jsx?$/,
|
||||
},
|
||||
loader: '@svgr/webpack',
|
||||
},
|
||||
// Webpack, by default, uses the url-loader for images and fonts that are required/included by
|
||||
// files it processes, which just base64 encodes them and inlines them in the javascript
|
||||
// bundles. This makes the javascript bundles ginormous and defeats caching so we will use the
|
||||
// file-loader instead to copy the files directly to the output directory.
|
||||
{
|
||||
test: /\.(woff2?|ttf|svg|eot)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'file-loader',
|
||||
},
|
||||
{
|
||||
test: /favicon.ico$/,
|
||||
loader: 'file-loader?name=[name].[ext]', // <-- retain original file name
|
||||
},
|
||||
{
|
||||
test: /\.(jpe?g|png|gif)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
'file-loader',
|
||||
{
|
||||
loader: 'image-webpack-loader',
|
||||
options: {
|
||||
optimizationlevel: 7,
|
||||
mozjpeg: {
|
||||
progressive: true,
|
||||
},
|
||||
gifsicle: {
|
||||
interlaced: false,
|
||||
},
|
||||
pngquant: {
|
||||
quality: '65-90',
|
||||
speed: 4,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// Specify additional processing or side-effects done on the Webpack output bundles as a whole.
|
||||
plugins: [
|
||||
// Generates an HTML file in the output directory.
|
||||
new HtmlWebpackPlugin({
|
||||
inject: true, // Appends script tags linking to the webpack bundles at the end of the body
|
||||
template: path.resolve(__dirname, '../public/index.html'),
|
||||
}),
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'development',
|
||||
BASE_URL: 'localhost:1997',
|
||||
LMS_BASE_URL: 'http://localhost:18000',
|
||||
CREDENTIALS_BASE_URL: 'http://localhost:18150',
|
||||
ECOMMERCE_BASE_URL: 'http://localhost:18130',
|
||||
LOGIN_URL: 'http://localhost:18000/login',
|
||||
LOGOUT_URL: 'http://localhost:18000/login',
|
||||
CSRF_TOKEN_API_PATH: '/csrf/api/v1/token',
|
||||
REFRESH_ACCESS_TOKEN_ENDPOINT: 'http://localhost:18000/login_refresh',
|
||||
SEGMENT_KEY: null,
|
||||
ACCESS_TOKEN_COOKIE_NAME: 'edx-jwt-cookie-header-payload',
|
||||
USER_INFO_COOKIE_NAME: 'edx-user-info',
|
||||
LANGUAGE_PREFERENCE_COOKIE_NAME: 'openedx-language-preference',
|
||||
SITE_NAME: 'edX',
|
||||
MARKETING_SITE_BASE_URL: 'http://localhost:18000',
|
||||
SUPPORT_URL: 'http://localhost:18000/support',
|
||||
CONTACT_URL: 'http://localhost:18000/contact',
|
||||
OPEN_SOURCE_URL: 'http://localhost:18000/openedx',
|
||||
TERMS_OF_SERVICE_URL: 'http://localhost:18000/terms-of-service',
|
||||
PRIVACY_POLICY_URL: 'http://localhost:18000/privacy-policy',
|
||||
FACEBOOK_URL: 'https://www.facebook.com',
|
||||
TWITTER_URL: 'https://twitter.com',
|
||||
YOU_TUBE_URL: 'https://www.youtube.com',
|
||||
LINKED_IN_URL: 'https://www.linkedin.com',
|
||||
REDDIT_URL: 'https://www.reddit.com',
|
||||
APPLE_APP_STORE_URL: 'https://www.apple.com/ios/app-store/',
|
||||
GOOGLE_PLAY_URL: 'https://play.google.com/store',
|
||||
ORDER_HISTORY_URL: 'localhost:1996/orders',
|
||||
ENTERPRISE_MARKETING_URL: 'http://example.com',
|
||||
ENTERPRISE_MARKETING_UTM_SOURCE: 'example.com',
|
||||
ENTERPRISE_MARKETING_UTM_CAMPAIGN: 'example.com Referral',
|
||||
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM: 'Footer',
|
||||
}),
|
||||
// when the --hot option is not passed in as part of the command
|
||||
// the HotModuleReplacementPlugin has to be specified in the Webpack configuration
|
||||
// https://webpack.js.org/configuration/dev-server/#devserver-hot
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
],
|
||||
// This configures webpack-dev-server which serves bundles from memory and provides live
|
||||
// reloading.
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 1997,
|
||||
historyApiFallback: true,
|
||||
hot: true,
|
||||
inline: true,
|
||||
publicPath: '/',
|
||||
},
|
||||
});
|
||||
@@ -1,218 +0,0 @@
|
||||
// This is the prod Webpack config. All settings here should prefer smaller,
|
||||
// optimized bundles at the expense of a longer build time.
|
||||
const Merge = require('webpack-merge');
|
||||
const commonConfig = require('./webpack.common.config.js');
|
||||
const path = require('path');
|
||||
const glob = require('glob');
|
||||
const webpack = require('webpack');
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin');
|
||||
const HtmlWebpackNewRelicPlugin = require('html-webpack-new-relic-plugin');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const PurgecssPlugin = require('purgecss-webpack-plugin');
|
||||
const NewRelicSourceMapPlugin = require('new-relic-source-map-webpack-plugin');
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; // eslint-disable-line prefer-destructuring
|
||||
const PostCssRtlPlugin = require('postcss-rtl');
|
||||
const PostCssAutoprefixerPlugin = require('autoprefixer');
|
||||
|
||||
module.exports = Merge.smart(commonConfig, {
|
||||
mode: 'production',
|
||||
devtool: 'source-map',
|
||||
output: {
|
||||
filename: '[name].[chunkhash].js',
|
||||
path: path.resolve(__dirname, '../dist'),
|
||||
},
|
||||
module: {
|
||||
// Specify file-by-file rules to Webpack. Some file-types need a particular kind of loader.
|
||||
rules: [
|
||||
// The babel-loader transforms newer ES2015+ syntax to older ES5 for older browsers.
|
||||
// Babel is configured with the .babelrc file at the root of the project.
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
include: [
|
||||
path.resolve(__dirname, '../src'),
|
||||
],
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
use: ['source-map-loader'],
|
||||
enforce: 'pre',
|
||||
},
|
||||
// Webpack, by default, includes all CSS in the javascript bundles. Unfortunately, that means:
|
||||
// a) The CSS won't be cached by browsers separately (a javascript change will force CSS
|
||||
// re-download). b) Since CSS is applied asyncronously, it causes an ugly
|
||||
// flash-of-unstyled-content.
|
||||
//
|
||||
// To avoid these problems, we extract the CSS from the bundles into separate CSS files that
|
||||
// can be included as <link> tags in the HTML <head> manually.
|
||||
//
|
||||
// We will not do this in development because it prevents hot-reloading from working and it
|
||||
// increases build time.
|
||||
{
|
||||
test: /(.scss|.css)$/,
|
||||
use: [
|
||||
MiniCssExtractPlugin.loader,
|
||||
{
|
||||
loader: 'css-loader', // translates CSS into CommonJS
|
||||
options: {
|
||||
sourceMap: true,
|
||||
minimize: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
plugins: () => [
|
||||
PostCssRtlPlugin(),
|
||||
PostCssAutoprefixerPlugin({ grid: true, browsers: ['>1%'] }),
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: 'sass-loader', // compiles Sass to CSS
|
||||
options: {
|
||||
sourceMap: true,
|
||||
includePaths: [
|
||||
path.join(__dirname, '../node_modules'),
|
||||
path.join(__dirname, '../src'),
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /.svg$/,
|
||||
issuer: {
|
||||
test: /\.jsx?$/,
|
||||
},
|
||||
loader: '@svgr/webpack',
|
||||
},
|
||||
// Webpack, by default, uses the url-loader for images and fonts that are required/included by
|
||||
// files it processes, which just base64 encodes them and inlines them in the javascript
|
||||
// bundles. This makes the javascript bundles ginormous and defeats caching so we will use the
|
||||
// file-loader instead to copy the files directly to the output directory.
|
||||
{
|
||||
test: /\.(woff2?|ttf|svg|eot)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
loader: 'file-loader',
|
||||
},
|
||||
{
|
||||
test: /favicon.ico$/,
|
||||
loader: 'file-loader?name=[name].[ext]', // <-- retain original file name
|
||||
},
|
||||
{
|
||||
test: /\.(jpe?g|png|gif)(\?v=\d+\.\d+\.\d+)?$/,
|
||||
use: [
|
||||
'file-loader',
|
||||
{
|
||||
loader: 'image-webpack-loader',
|
||||
options: {
|
||||
optimizationlevel: 7,
|
||||
mozjpeg: {
|
||||
progressive: true,
|
||||
},
|
||||
gifsicle: {
|
||||
interlaced: false,
|
||||
},
|
||||
pngquant: {
|
||||
quality: '65-90',
|
||||
speed: 4,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
// New in Webpack 4. Replaces CommonChunksPlugin. Extract common modules among all chunks to one
|
||||
// common chunk and extract the Webpack runtime to a single runtime chunk.
|
||||
optimization: {
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
chunks: 'all',
|
||||
},
|
||||
},
|
||||
// Specify additional processing or side-effects done on the Webpack output bundles as a whole.
|
||||
plugins: [
|
||||
// Cleans the dist directory before each build
|
||||
new CleanWebpackPlugin(['dist'], {
|
||||
root: path.join(__dirname, '../'),
|
||||
}),
|
||||
// Writes the extracted CSS from each entry to a file in the output directory.
|
||||
new MiniCssExtractPlugin({
|
||||
filename: '[name].[chunkhash].css',
|
||||
}),
|
||||
// Scan files for class names and ids and remove unused css
|
||||
new PurgecssPlugin({
|
||||
paths: [].concat(
|
||||
// Scan files in this app
|
||||
glob.sync(`${path.resolve(__dirname, '../src')}/**/*`, { nodir: true }),
|
||||
// Scan files in any edx frontend-component
|
||||
glob.sync(`${path.resolve(__dirname, '../node_modules/@edx/frontend-component')}*/**/*`, { nodir: true }),
|
||||
// Scan files in paragon
|
||||
glob.sync(`${path.resolve(__dirname, '../node_modules/@edx/paragon')}/**/*`, { nodir: true }),
|
||||
),
|
||||
// Protect react-css-transition class names
|
||||
whitelistPatterns: [/-enter/, /-appear/, /-exit/],
|
||||
}),
|
||||
// Generates an HTML file in the output directory.
|
||||
new HtmlWebpackPlugin({
|
||||
inject: true, // Appends script tags linking to the webpack bundles at the end of the body
|
||||
template: path.resolve(__dirname, '../public/index.html'),
|
||||
}),
|
||||
new webpack.EnvironmentPlugin({
|
||||
NODE_ENV: 'production',
|
||||
BASE_URL: null,
|
||||
LMS_BASE_URL: null,
|
||||
CREDENTIALS_BASE_URL: null,
|
||||
ECOMMERCE_BASE_URL: null,
|
||||
LOGIN_URL: null,
|
||||
LOGOUT_URL: null,
|
||||
CSRF_TOKEN_API_PATH: null,
|
||||
REFRESH_ACCESS_TOKEN_ENDPOINT: null,
|
||||
SEGMENT_KEY: null,
|
||||
ACCESS_TOKEN_COOKIE_NAME: null,
|
||||
USER_INFO_COOKIE_NAME: null,
|
||||
LANGUAGE_PREFERENCE_COOKIE_NAME: null,
|
||||
SITE_NAME: null,
|
||||
MARKETING_SITE_BASE_URL: null,
|
||||
SUPPORT_URL: null,
|
||||
CONTACT_URL: null,
|
||||
OPEN_SOURCE_URL: null,
|
||||
TERMS_OF_SERVICE_URL: null,
|
||||
PRIVACY_POLICY_URL: null,
|
||||
FACEBOOK_URL: null,
|
||||
TWITTER_URL: null,
|
||||
YOU_TUBE_URL: null,
|
||||
LINKED_IN_URL: null,
|
||||
REDDIT_URL: null,
|
||||
APPLE_APP_STORE_URL: null,
|
||||
GOOGLE_PLAY_URL: null,
|
||||
ORDER_HISTORY_URL: null,
|
||||
NEW_RELIC_ADMIN_KEY: null,
|
||||
NEW_RELIC_APP_ID: null,
|
||||
NEW_RELIC_LICENSE_KEY: null,
|
||||
ENTERPRISE_MARKETING_URL: null,
|
||||
ENTERPRISE_MARKETING_UTM_SOURCE: null,
|
||||
ENTERPRISE_MARKETING_UTM_CAMPAIGN: null,
|
||||
ENTERPRISE_MARKETING_FOOTER_UTM_MEDIUM: null,
|
||||
}),
|
||||
new HtmlWebpackNewRelicPlugin({
|
||||
// This plugin fixes an issue where the newrelic script will break if
|
||||
// not added directly to the HTML.
|
||||
// We use non empty strings as defaults here to prevent errors for empty configs
|
||||
license: process.env.NEW_RELIC_LICENSE_KEY || 'fake_app',
|
||||
applicationID: process.env.NEW_RELIC_APP_ID || 'fake_license',
|
||||
}),
|
||||
new NewRelicSourceMapPlugin({
|
||||
applicationId: process.env.NEW_RELIC_APP_ID,
|
||||
nrAdminKey: process.env.NEW_RELIC_ADMIN_KEY,
|
||||
staticAssetUrl: process.env.BASE_URL,
|
||||
noop: typeof process.env.NEW_RELIC_ADMIN_KEY === 'undefined', // upload source maps in prod builds only
|
||||
}),
|
||||
new BundleAnalyzerPlugin({
|
||||
analyzerMode: 'static',
|
||||
openAnalyzer: false,
|
||||
}),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user