Skip to content

Commit

Permalink
Merge pull request #4466 from storybooks/support-mjs
Browse files Browse the repository at this point in the history
Support "mjs" extensions
  • Loading branch information
ndelangen authored Oct 18, 2018
2 parents a041e81 + e831afd commit a9e8e42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/core/src/server/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default ({ configDir, quiet, babelOptions, entries }) => {
module: {
rules: [
{
test: /\.jsx?$/,
test: /\.(mjs|jsx?)$/,
use: [
{
loader: 'babel-loader',
Expand All @@ -94,7 +94,7 @@ export default ({ configDir, quiet, babelOptions, entries }) => {
resolve: {
// Since we ship with json-loader always, it's better to move extensions to here
// from the default config.
extensions: ['.js', '.jsx', '.json'],
extensions: ['.js', '.jsx', '.json', '.mjs'],
// Add support to NODE_PATH. With this we could avoid relative path imports.
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules'].concat(nodePaths),
Expand Down
4 changes: 2 additions & 2 deletions lib/core/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default ({ configDir, babelOptions, entries }) => {
module: {
rules: [
{
test: /\.jsx?$/,
test: /\.(mjs|jsx?)$/,
use: [
{
loader: 'babel-loader',
Expand All @@ -80,7 +80,7 @@ export default ({ configDir, babelOptions, entries }) => {
resolve: {
// Since we ship with json-loader always, it's better to move extensions to here
// from the default config.
extensions: ['.js', '.jsx', '.json'],
extensions: ['.js', '.jsx', '.json', '.mjs'],
// Add support to NODE_PATH. With this we could avoid relative path imports.
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253
modules: ['node_modules'].concat(nodePaths),
Expand Down

0 comments on commit a9e8e42

Please sign in to comment.