Skip to content

Commit

Permalink
fix(babel): Add source type option to babel config for module inferen…
Browse files Browse the repository at this point in the history
…ce (#325)

This fixes an issue where babel can get confused about what type of file it is parsing (e.g. module/scripts). This is specifically a problem in sku for `compilePackages`. See the related babel issue here: babel/babel#9238.
  • Loading branch information
mattcompiles authored Feb 26, 2019
1 parent 0b28fe5 commit cc6b402
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/babel/babelConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = ({ target, lang = 'js' }) => {

return {
babelrc: false,
sourceType: 'unambiguous',
presets: [
languagePreset,
[require.resolve('@babel/preset-env'), envPresetOptions],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('react-css-modules', () => {

it('should start a storybook server', async () => {
const page = await browser.newPage();
await page.goto(storybookUrl);
await page.goto(storybookUrl, { waitUntil: 'networkidle2' });

const content = await page.evaluate(async () => {
const element = await window.document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('typescript-css-modules', () => {

it('should start a storybook server', async () => {
const page = await browser.newPage();
await page.goto(storybookUrl);
await page.goto(storybookUrl, { waitUntil: 'networkidle2' });

const content = await page.evaluate(async () => {
const element = await window.document
Expand Down

0 comments on commit cc6b402

Please sign in to comment.