-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathindex.js
120 lines (109 loc) · 3.25 KB
/
index.js
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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
const path = require('path');
/**
* AEM
*
* This configuration is used by different tools, such as Webpack and Jest.
*/
const AEM = {
projectFolderName: '__appsFolderName__',
libraryName: 'Project_Component_Library',
jcrRoot: path.resolve(__dirname, '../content/jcr_root/'),
};
/**
* WEBPACK
*/
const WEBPACK = {
/**
* Optional: You can base this config on another Webpack config.
* More details: https://github.com/webpack-contrib/config-loader/blob/master/docs/EXTENDS.md
* NOTE: We haven't thoroughly tested this feature yet.
* It's unclear how other Webpack configs will behave when combined with our base configuration.
*/
// extends: [
// path.join(__dirname, '../webpack.config.shared.js'),
// ],
/*
* Here we can add specify as many entries as we want. One entry results in one output file.
* The property name ("components") defines how the target file is named, e.g. 'main' results in 'main.bundle.js'.
* The property's value ("path.resolve...") is the path to an entry file.
* More details: https://webpack.js.org/concepts/entry-points/
*/
entry: {
components: path.resolve(__dirname, './entries/components.js'),
// 'other-components': path.resolve(__dirname, './entries/other-components.js'),
},
};
/**
* ESLINT
*
* The linting rules defined here are pretty loose, allowing you to integrate the Webpack setup
* more easily into your existing project. However, we recommend to make the rules more strict –
* as strict as possible.
*/
const ESLINT = {
// Optional: Replace `eslint:recommended` with `eslint-config-infield` and run
// `npm install --save-dev eslint-config-infield` for stricter linting rules
extends: "eslint:recommended",
// If you want to define variables that are available across various processed JavaScript
// files, define them here. More details: http://eslint.org/docs/user-guide/configuring#specifying-globals
globals: {
$: true,
Granite: true,
},
rules: {
"no-console": "off",
options: {
emitError: true,
emitWarning: true
}
},
};
/**
* STYLELINT
*/
const STYLELINT = {
// Optional: Base you configuration on a different one such as `stylelint-config-infield`
// and run `npm install --save-dev stylelint-config-infield`
// extends: "stylelint-config-infield",
rules: {
"block-no-empty": null,
"color-no-invalid-hex": true,
"comment-empty-line-before": ["always", {
"ignore": ["after-comment"]
}],
"declaration-colon-space-after": "always",
indentation: ["tab", {
except: ["value"]
}],
"max-empty-lines": 2,
"rule-empty-line-before": ["always", {
except: ["first-nested"],
ignore: ["after-comment"]
}],
"unit-whitelist": ["px", "em", "rem", "%", "s"],
},
};
/**
* BABEL
*
* You can override or extend the default BABEL configuration using options from
* https://babeljs.io/docs/usage/api/#options
*/
const BABEL = {
// You can set a path to your project-specific .babelrc file as follows:
// extends: path.resolve(__dirname, '../.babelrc'),
};
/**
* JEST
*
* You can override or extend JEST, but you don't have to.
*/
const JEST = {};
module.exports = {
aem: AEM,
babel: BABEL,
eslint: ESLINT,
jest: JEST,
stylelint: STYLELINT,
webpack: WEBPACK,
};