Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active April 25, 2019 06:09
Show Gist options
  • Save davidgilbertson/24aacb04a33a647dc08046498f1f5a25 to your computer and use it in GitHub Desktop.
Save davidgilbertson/24aacb04a33a647dc08046498f1f5a25 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