Skip to content

Commit

Permalink
fix(build): commonjs fix, put html files into the distribution (#2452)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher A. Dhanaraj authored and GitHub Enterprise committed Mar 24, 2017
1 parent 266d715 commit f276311
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
12 changes: 10 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const cloptions = require('minimist')(process.argv.slice(2), {
* BrowserSync
*/

gulp.task('browser-sync', () => {
gulp.task('browser-sync', ['build:dev'], () => {
browserSync.init({
logPrefix: 'Carbon Components',
open: false,
Expand All @@ -59,6 +59,7 @@ gulp.task('clean', () => del([
'es',
'umd',
'scripts',
'html',
'dist',
'demo/**/*.{js,map}',
'!demo/js/demo-switcher.js',
Expand Down Expand Up @@ -186,6 +187,13 @@ gulp.task('sass:source', () => {
.pipe(gulp.dest('sass'));
});

gulp.task('html:source', () => {
const srcFiles = './src/components/**/*.html';

return gulp.src(srcFiles)
.pipe(gulp.dest('html'));
});

/**
* Lint
*/
Expand Down Expand Up @@ -245,7 +253,7 @@ gulp.task('build:scripts', ['scripts:umd', 'scripts:es', 'scripts:compiled']);
gulp.task('build:styles', ['sass:compiled', 'sass:source']);

// Mapped to npm run build
gulp.task('build', ['build:scripts', 'build:styles']);
gulp.task('build', ['build:scripts', 'build:styles', 'html:source']);

// For demo environment
gulp.task('build:dev', ['sass:dev', 'scripts:dev']);
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
"npm": "~3.0.0"
},
"dependencies": {
"carbon-icons": "5.0.1",
"adaro": "1.0.4",
"bluebird": "~3.1.1",
"carbon-icons": "5.0.1",
"eslint": "^3.0.0",
"express": "4.13.4",
"globby": "4.0.0",
"lodash-es": "^4.17.4"
"lodash.debounce": "^4.0.8"
},
"devDependencies": {
"babel-core": "^6.22.0",
Expand Down Expand Up @@ -134,6 +134,7 @@
"scripts/**/*",
"sass/**/*",
"css/**/*",
"html/**/*",
"src/**/*"
],
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/components/detail-page-header/detail-page-header.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import debounce from 'lodash-es/debounce';
import debounce from 'lodash.debounce';
import mixin from '../../globals/js/misc/mixin';
import createComponent from '../../globals/js/mixins/create-component';
import initComponentBySearch from '../../globals/js/mixins/init-component-by-search';
Expand Down
11 changes: 10 additions & 1 deletion tools/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const commonjs = require('rollup-plugin-commonjs');
const resolve = require('rollup-plugin-node-resolve');
const babel = require('rollup-plugin-babel');

Expand All @@ -7,8 +8,16 @@ module.exports = {
moduleName: 'CarbonComponents',
plugins: [
resolve(),
commonjs({
include: 'node_modules/**',
sourceMap: false,
}),
babel({
exclude: 'node_modules/**', // only transpile our source code
exclude:
[
'node_modules/**',
], // only transpile our source code

}),
],
dest: 'scripts/carbon-components.js',
Expand Down

0 comments on commit f276311

Please sign in to comment.