0.11.2 • Published 4 years ago

parallax-common-config v0.11.2

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

parallax-common-config

Version npm Dependencies peerDependencies Known Vulnerabilities License

This is a module with all parallax-common-config configurations for team-parallax.

Note

This is a module with opinionated configurations you might find useful. This is used internally at team-parallax.

Installation

yarn add -D parallax-common-config

Additional dependencies are required for eslint, webpack to run smoothly:

yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser autoprefixer awesome-typescript-loader cache-loader css-loader css-modules-typescript-loader eslint-config-react-app eslint-loader eslint-plugin-filenames eslint-plugin-sort-keys-fix eslint-plugin-import-alias eslint-plugin-jsdoc eslint-plugin-react eslint-plugin-sort-imports-es6-autofix eslint-plugin-unused-imports extract-css-chunks-webpack-plugin file-loader html-webpack-plugin style-loader svg-inline-loader typescript typescript-eslint-parser typings-for-css-modules-loader url-loader webpack-merge eslint-plugin-import

Usage

.editorconfig

Create a symlink to use our .editorconfig

ln -s node_modules/parallax-common-config/.editorconfig .editorconfig

.gitlab-ci.common.yml

Create a symlink to use our .gitlab-ci.common.yml

ln -s node_modules/parallax-common-config/.gitlab-ci.common.yml .gitlab-ci.common.yml

.browserlistrc

Create a symlink to use our .editorconfig

ln -s node_modules/parallax-common-config/.browserlistrc .browserlistrc

.eslintrc

Add this to your .eslintrc

{
	"extends": [
		"./node_modules/parallax-common-config/.eslintrc",
		"./node_modules/parallax-common-config/.eslintrc.react",
		"./node_modules/parallax-common-config/.eslintrc.typescript"
	]
}

Note that there are also .eslintrc.prod files which return errors instead of warnings. This is useful for CI pipelines - use them like so

{
	"extends": [
		"./node_modules/parallax-common-config/.eslintrc",
		"./node_modules/parallax-common-config/.eslintrc.react",
		"./node_modules/parallax-common-config/.eslintrc.prod",
		"./node_modules/parallax-common-config/.eslintrc.react.prod",
		"./node_modules/parallax-common-config/.eslintrc.typescript" // TODO: create a prod-version of this one
	]
}

tsconfig

{
	"extends": "./node_modules/parallax-common-config/tsconfig.react"
}

Webpack

We utilize webpack-merge in order to modularize our webpack configurations.

const webpack = require("webpack");
const merge = require("webpack-merge");
const path = require("path");
const webpackDev = require("./node_modules/parallax-common-config/webpack.config.dev");
const webpackProd = require("./node_modules/parallax-common-config/webpack.config.prod");
const webpackCommon = require("./node_modules/parallax-common-config/webpack.config.common");
const webpackReact = require("./node_modules/parallax-common-config/webpack.config.react");
module.exports = (env, argv) => {
	const dev = argv.mode === "development";
	return merge(webpackCommon, webpackReact, dev
		? webpackDev({})
		: webpackProd({}), {
		plugins: [
			new webpack.EnvironmentPlugin({
				MODE: dev
					? "development"
					: "production"
			})
		],
		resolve: {
			alias: {
				"~": path.resolve(__dirname, "src/"),
				Api: path.resolve(__dirname, "src/api/"),
				Components: path.resolve(__dirname, "src/components/"),
				Models: path.resolve(__dirname, "src/models/"),
				Services: path.resolve(__dirname, "src/services/"),
				Stores: path.resolve(__dirname, "src/stores/"),
				Views: path.resolve(__dirname, "src/views/")
			}
		}
	});
};

TODOs

0.11.2

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.21

4 years ago

0.10.20

4 years ago

0.10.19

4 years ago

0.10.18

4 years ago

0.10.17

4 years ago

0.10.16

4 years ago

0.10.15

4 years ago

0.10.14

4 years ago

0.10.12

4 years ago

0.10.13

4 years ago

0.10.9

4 years ago

0.10.8

4 years ago

0.10.6

4 years ago

0.10.7

4 years ago

0.10.5

4 years ago

0.10.4

4 years ago

0.10.3

4 years ago

0.10.1

4 years ago

0.10.2

4 years ago

0.10.0

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.5.0

4 years ago

0.7.0

4 years ago

0.5.2

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.3.0

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.5

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago