Skip to content

Commit 1ee0ae1

Browse files
authored
fix: change require.resolve to path.join to fix webpack prod issues
1 parent 7426339 commit 1ee0ae1

35 files changed

+103
-69
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"scripts:lint:fix": "eslint --fix 'scripts/**' --ext .js,.jsx --env browser,node",
3232
"size": "npm run build && size-limit",
3333
"size:debug": "npm run build && size-limit --why",
34-
"start": "node scripts/start.js",
34+
"start": "npm run build && node scripts/start.js",
3535
"start:playground": "FUNDAMENTAL_REACT_PLAYGROUND=true npm start",
3636
"std-version": "standard-version -m \"chore(release): version %s build ${TRAVIS_BUILD_NUMBER} [ci skip]\"",
3737
"test:coverage": "jest --coverage",

src/ActionBar/ActionBar.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import React from 'react';
23
import { ActionBar, ActionBarActions, ActionBarBack, ActionBarHeader, Button, Menu, MenuItem, MenuList, Popover } from '../';
34
import { Description, DocsText, DocsTile, Header, Import, Properties, Separator } from '../_playground';
@@ -94,11 +95,11 @@ const clickBackBtn = () => {
9495
The **Action Bar** is located at the top of the page and is used for page title and main actions for the
9596
page.
9697
</Description>
97-
<Import sourceModulePath={require.resolve('./ActionBar')} />
98+
<Import sourceModulePath={path.join(__dirname, './ActionBar')} />
9899

99100
<Separator />
100101

101-
<Properties sourceModulePath={require.resolve('./ActionBar')} />
102+
<Properties sourceModulePath={path.join(__dirname, './ActionBar')} />
102103

103104
<Separator />
104105

src/Alert/Alert.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable jsx-a11y/anchor-is-valid */
2+
import path from 'path';
23
import React from 'react';
34
import { Alert, Icon } from '../';
45
import { Description, DocsText, DocsTile, Header, Import, Playground, Properties, Separator } from '../_playground';
@@ -38,11 +39,11 @@ export const AlertComponent = () => {
3839
<Description>
3940
An **Alert** provides a message within the application that is color-coded to emphasize the level of urgency.
4041
</Description>
41-
<Import sourceModulePath={require.resolve('./Alert')} />
42+
<Import sourceModulePath={path.join(__dirname, './Alert')} />
4243

4344
<Separator />
4445

45-
<Properties sourceModulePath={require.resolve('./Alert')} />
46+
<Properties sourceModulePath={path.join(__dirname, './Alert')} />
4647

4748
<Separator />
4849

src/Badge/Badge.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import React from 'react';
23
import { Badge, Button, Counter, Label, Status } from '../';
34
import { Description, DocsText, DocsTile, Header, Import, Playground, Properties, Separator } from '../_playground';
@@ -63,11 +64,11 @@ export const BadgeComponent = () => {
6364
<div>
6465
<Header>Status Indicators</Header>
6566
<Description>Status Indicators are used to easily highlight the state of an object.</Description>
66-
<Import sourceModulePath={require.resolve('./Badge')} />
67+
<Import sourceModulePath={path.join(__dirname, './Badge')} />
6768

6869
<Separator />
6970

70-
<Properties sourceModulePath={require.resolve('./Badge')} />
71+
<Properties sourceModulePath={path.join(__dirname, './Badge')} />
7172

7273
<Separator />
7374

src/Breadcrumb/Breadcrumb.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Link } from 'react-router-dom';
2+
import path from 'path';
23
import React from 'react';
34
import { Breadcrumb, BreadcrumbItem } from '../';
45
import { Description, DocsText, DocsTile, Header, Import, Properties, Separator } from '../_playground';
@@ -30,11 +31,11 @@ export const BreadcrumbComponent = () => {
3031
to previous levels in the path. When clicking on the current page, a dropdown allows users to access
3132
other pages at that same level.
3233
</Description>
33-
<Import sourceModulePath={require.resolve('./Breadcrumb')} />
34+
<Import sourceModulePath={path.join(__dirname, './Breadcrumb')} />
3435

3536
<Separator />
3637

37-
<Properties sourceModulePath={require.resolve('./Breadcrumb')} />
38+
<Properties sourceModulePath={path.join(__dirname, './Breadcrumb')} />
3839

3940
<Separator />
4041

src/Button/Button.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import React from 'react';
23
import { Button, ButtonGroup } from '../';
34
import { Description, DocsText, DocsTile, Header, Import, Playground, Properties, Separator } from '../_playground';
@@ -135,11 +136,11 @@ content like appearing in a table or list. There may be more than one on the pag
135136
instance, the most important button has a blue background where as a red button should only be used if
136137
the action it performs is potentially destructive.
137138
</Description>
138-
<Import sourceModulePath={require.resolve('./Button')} />
139+
<Import sourceModulePath={path.join(__dirname, './Button')} />
139140

140141
<Separator />
141142

142-
<Properties sourceModulePath={require.resolve('./Button')} />
143+
<Properties sourceModulePath={path.join(__dirname, './Button')} />
143144

144145
<Separator />
145146

src/Calendar/Calendar.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Calendar } from '../';
2+
import path from 'path';
23
import React from 'react';
34
import { Description, DocsText, DocsTile, Header, Import, Properties, Separator } from '../_playground';
45

@@ -15,11 +16,11 @@ export const CalendarComponent = () => {
1516
The **Calendar** is commonly used as the contents of a **Popover** when composing a **Date Picker**.
1617
It is rarely used on its own as a standalone component.
1718
</Description>
18-
<Import sourceModulePath={require.resolve('./Calendar')} />
19+
<Import sourceModulePath={path.join(__dirname, './Calendar')} />
1920

2021
<Separator />
2122

22-
<Properties sourceModulePath={require.resolve('./Calendar')} />
23+
<Properties sourceModulePath={path.join(__dirname, './Calendar')} />
2324

2425
<Separator />
2526

src/ComboboxInput/ComboboxInput.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import React from 'react';
23
import { ComboboxInput, Menu, MenuItem, MenuList } from '../';
34
import { DocsText, DocsTile, Header, Import, Properties, Separator } from '../_playground';
@@ -40,11 +41,11 @@ export const ComboboxInputComponent = () => {
4041
<div>
4142
<Header>Combobox Input</Header>
4243

43-
<Import sourceModulePath={require.resolve('./ComboboxInput')} />
44+
<Import sourceModulePath={path.join(__dirname, './ComboboxInput')} />
4445

4546
<Separator />
4647

47-
<Properties sourceModulePath={require.resolve('./ComboboxInput')} />
48+
<Properties sourceModulePath={path.join(__dirname, './ComboboxInput')} />
4849

4950
<Separator />
5051

src/DatePicker/DatePicker.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { DatePicker } from '../';
2+
import path from 'path';
23
import React from 'react';
34
import { Description, DocsText, DocsTile, Header, Import, Properties, Separator } from '../_playground';
45

@@ -19,11 +20,11 @@ export const DatePickerComponent = () => {
1920
The **Date Picker** is an opinionated composition of the **Input Group**, **Popover**
2021
and **Calendar** components to accomplish the UI pattern for picking a date.
2122
</Description>
22-
<Import sourceModulePath={require.resolve('./DatePicker')} />
23+
<Import sourceModulePath={path.join(__dirname, './DatePicker')} />
2324

2425
<Separator />
2526

26-
<Properties sourceModulePath={require.resolve('./DatePicker')} />
27+
<Properties sourceModulePath={path.join(__dirname, './DatePicker')} />
2728

2829
<Separator />
2930

src/Dropdown/Dropdown.Component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path';
12
import React from 'react';
23
import { Button, Dropdown, Menu, MenuItem, MenuList, Popover } from '../';
34
import { Description, DocsText, DocsTile, Header, Import, Properties, Separator } from '../_playground';
@@ -161,11 +162,11 @@ export const DropdownComponent = () => {
161162
The **Dropdown** component lets the user select one of the different options.
162163
It is more flexible than the normal Select.
163164
</Description>
164-
<Import sourceModulePath={require.resolve('./Dropdown')} />
165+
<Import sourceModulePath={path.join(__dirname, './Dropdown')} />
165166

166167
<Separator />
167168

168-
<Properties sourceModulePath={require.resolve('./Dropdown')} />
169+
<Properties sourceModulePath={path.join(__dirname, './Dropdown')} />
169170

170171
<Separator />
171172

0 commit comments

Comments
 (0)