Skip to content

Instantly share code, notes, and snippets.

@spac3unit
Forked from davidgilbertson/neat-imports.js
Created October 8, 2018 01:06
Show Gist options
  • Select an option

  • Save spac3unit/f84ac30139d7cd91e18d59686029e779 to your computer and use it in GitHub Desktop.

Select an option

Save spac3unit/f84ac30139d7cd91e18d59686029e779 to your computer and use it in GitHub Desktop.
/* -- webpack.config.shared.js -- */
export const sharedConfig = {
alias: {
'Utils': path.resolve(__dirname, '../src/app/utils/'),
'Components': path.resolve(__dirname, '../src/app/components/'),
},
};
/* -- webpack.config.dev.js -- */
import { sharedConfig } from './webpack.config.shared.js';
const config = {
// development config
resolve: {
alias: sharedConfig.alias,
},
};
/* -- webpack.config.prod.js -- */
import { sharedConfig } from './webpack.config.shared.js';
const config = {
// production config
resolve: {
alias: sharedConfig.alias,
},
};
/* -- SomeComponent.js -- */
import toNumber from 'Utils/toNumber';
import toString from 'Utils/toString';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment