Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
7aeba652
Commit
7aeba652
authored
Dec 18, 2019
by
Steven Vachon
Committed by
Ryan McKinley
Dec 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
@grafana/toolkit: webpack extend TS→JS (#21176)
parent
06347e3f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
29 deletions
+24
-29
packages/grafana-toolkit/README.md
+4
-7
packages/grafana-toolkit/src/config/mocks/webpack/overrides/webpack.config.js
+10
-0
packages/grafana-toolkit/src/config/mocks/webpack/overrides/webpack.config.ts
+0
-10
packages/grafana-toolkit/src/config/mocks/webpack/overridesNamedExport/webpack.config.js
+8
-0
packages/grafana-toolkit/src/config/mocks/webpack/overridesNamedExport/webpack.config.ts
+0
-8
packages/grafana-toolkit/src/config/mocks/webpack/unsupportedOverride/webpack.config.js
+1
-3
packages/grafana-toolkit/src/config/webpack.plugin.config.ts
+1
-1
No files found.
packages/grafana-toolkit/README.md
View file @
7aeba652
...
...
@@ -129,23 +129,20 @@ Currently we support following Jest configuration properties:
### How can I customize Webpack rules or plugins?
You can provide your own webpack configuration.
Provide a function implementing
`CustomWebpackConfigurationGetter`
in a file named
`webpack.config.
t
s`
.
Provide a function implementing
`CustomWebpackConfigurationGetter`
in a file named
`webpack.config.
j
s`
.
You can import the correct interface and Options from
`@grafana/toolkit/src/config`
.
Example
```
ts
import
{
CustomWebpackConfigurationGetter
}
from
'@grafana/toolkit/src/config'
```
js
import
CustomPlugin
from
'custom-plugin'
;
const
getWebpackConfig
:
CustomWebpackConfigurationGetter
=
(
defaultConfig
,
options
)
=>
{
export
const
getWebpackConfig
=
(
defaultConfig
,
options
)
=>
{
console
.
log
(
'Custom config'
);
defaultConfig
.
plugins
.
push
(
new
CustomPlugin
())
return
defaultConfig
;
}
export
=
getWebpackConfig
;
};
```
### How can I style my plugin?
...
...
packages/grafana-toolkit/src/config/mocks/webpack/overrides/webpack.config.js
0 → 100644
View file @
7aeba652
'use strict'
;
const
{
cloneDeep
}
=
require
(
'lodash'
);
const
overrideWebpackConfig
=
(
originalConfig
,
options
)
=>
{
const
config
=
cloneDeep
(
originalConfig
);
config
.
name
=
'customConfig'
;
return
config
;
};
module
.
exports
=
overrideWebpackConfig
;
packages/grafana-toolkit/src/config/mocks/webpack/overrides/webpack.config.ts
deleted
100644 → 0
View file @
06347e3f
import
{
CustomWebpackConfigurationGetter
}
from
'../../../webpack.plugin.config'
;
import
_
from
'lodash'
;
const
overrideWebpackConfig
:
CustomWebpackConfigurationGetter
=
(
originalConfig
,
options
)
=>
{
const
config
=
_
.
cloneDeep
(
originalConfig
);
config
.
name
=
'customConfig'
;
return
config
;
};
export
=
overrideWebpackConfig
;
packages/grafana-toolkit/src/config/mocks/webpack/overridesNamedExport/webpack.config.js
0 → 100644
View file @
7aeba652
'use strict'
;
const
{
cloneDeep
}
=
require
(
'lodash'
);
module
.
exports
.
getWebpackConfig
=
(
originalConfig
,
options
)
=>
{
const
config
=
cloneDeep
(
originalConfig
);
config
.
name
=
'customConfig'
;
return
config
;
};
packages/grafana-toolkit/src/config/mocks/webpack/overridesNamedExport/webpack.config.ts
deleted
100644 → 0
View file @
06347e3f
import
{
CustomWebpackConfigurationGetter
}
from
'../../../webpack.plugin.config'
;
import
_
from
'lodash'
;
export
const
getWebpackConfig
:
CustomWebpackConfigurationGetter
=
(
originalConfig
,
options
)
=>
{
const
config
=
_
.
cloneDeep
(
originalConfig
);
config
.
name
=
'customConfig'
;
return
config
;
};
packages/grafana-toolkit/src/config/mocks/webpack/unsupportedOverride/webpack.config.
t
s
→
packages/grafana-toolkit/src/config/mocks/webpack/unsupportedOverride/webpack.config.
j
s
View file @
7aeba652
/* WRONG CONFIG ON PURPOSE - DO NOT COPY THIS */
const
config
=
{
module
.
exports
.
config
=
{
name
:
'test'
,
};
export
=
config
;
packages/grafana-toolkit/src/config/webpack.plugin.config.ts
View file @
7aeba652
...
...
@@ -235,7 +235,7 @@ const getBaseWebpackConfig: WebpackConfigurationGetter = async options => {
export
const
loadWebpackConfig
:
WebpackConfigurationGetter
=
async
options
=>
{
const
baseConfig
=
await
getBaseWebpackConfig
(
options
);
const
customWebpackPath
=
path
.
resolve
(
process
.
cwd
(),
'webpack.config.
t
s'
);
const
customWebpackPath
=
path
.
resolve
(
process
.
cwd
(),
'webpack.config.
j
s'
);
try
{
await
accessPromise
(
customWebpackPath
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment