-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(contributor-workflow): improve contributor workflow for react co…
…mponents - No longer need to publish to npm to see changes in styleguide or in tests - Speed up monolith recompile time - Replace browserify with webpack - Modify vendored modernizr to work with webpack [Finishes #95551542]
- Loading branch information
1 parent
d93dd4c
commit f15b66d
Showing
9 changed files
with
91 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
module.exports = { | ||
import puiAliases from '../../helpers/pui-aliases'; | ||
|
||
export default { | ||
devtool: 'inline-source-map', | ||
watch: true | ||
}; | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader?stage=0' | ||
}, | ||
{ | ||
test: /bootstrap/, | ||
loader: 'imports?jQuery=jquery' | ||
} | ||
] | ||
}, | ||
resolve: { | ||
alias: Object.assign({ | ||
bootstrap: `${__dirname}/../../node_modules/bootstrap-sass/assets/javascripts/bootstrap.js`, | ||
modernizr: `${__dirname}/../../src/modernizr/modernizr.min.js` | ||
}, puiAliases) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
module.exports = { | ||
import puiAliases from '../../helpers/pui-aliases'; | ||
|
||
export default { | ||
devtool: 'eval', | ||
entry: null, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /\.js$/, | ||
exclude: /node_modules/, | ||
loader: 'babel-loader?stage=0' | ||
} | ||
] | ||
}, | ||
output: {filename: 'spec.js' }, | ||
quiet: true, | ||
resolve: { | ||
alias: { | ||
alias: Object.assign({ | ||
'raf': `${__dirname}/../../spec/pivotal-ui-react/support/mock_raf.js`, | ||
'performance-now': `${__dirname}/../../spec/pivotal-ui-react/support/mock_performance_now.js`, | ||
'lodash.throttle': `${__dirname}/../../spec/pivotal-ui-react/support/mock_throttle.js` | ||
} | ||
}, | ||
watch: true, | ||
externals: null | ||
}; | ||
}, puiAliases) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import glob from 'glob'; | ||
import path from 'path'; | ||
|
||
const reactPackageDirs = glob.sync('src/pivotal-ui-react/*', {realpath: true}); | ||
|
||
export default reactPackageDirs.reduce((memo, packageDir) => { | ||
const componentName = path.basename(packageDir); | ||
memo[`pui-react-${componentName}\$`] = path.join(packageDir, `${componentName}.js`); | ||
memo[`pui-react-${componentName}`] = packageDir; | ||
return memo; | ||
}, {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import gulp from 'gulp'; | ||
const runSequence = require('run-sequence').use(gulp); | ||
|
||
gulp.task('setup-watchers', (callback) => { | ||
process.env.WEBPACK_WATCH = true; | ||
gulp.watch(['src/pivotal-ui/components/**/*.scss'], ['monolith-hologram', 'monolith-build-css-from-cache']); | ||
gulp.watch(['src/styleguide/**/*.scss'], ['monolith-styleguide-css']); | ||
callback(); | ||
}); | ||
|
||
gulp.task('dev', (callback) => runSequence( | ||
'setup-watchers', | ||
'monolith-serve', | ||
callback | ||
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters