refactor source code layout

master
f0x 5 years ago
parent 774616147d
commit 0e3460ab49

@ -15,7 +15,7 @@ const sourcemaps = require('gulp-sourcemaps')
const budo = require('budo')
const babelify = require('babelify')
const cssFiles = 'public/scss/**/*.?(s)css'
const cssFiles = 'src/scss/**/*.?(s)css'
let css = gulp.src(cssFiles)
.pipe(sass())
@ -23,7 +23,7 @@ let css = gulp.src(cssFiles)
.pipe(gulp.dest('build'))
gulp.task('watch', function(cb) {
budo("app.js", {
budo("src/app.js", {
live: true,
dir: "build",
port: 3000,
@ -47,7 +47,7 @@ gulp.task("sass", function() {
})
gulp.task("assets", function() {
return gulp.src(["public/**/*", "!public/scss", "!public/scss/**/*"])
return gulp.src(["src/assets/**/*"])
.pipe(gulpIf('*.+(png|jpg|jpeg|gif|svg)',
cache(imagemin({
interlaced: true
@ -57,7 +57,7 @@ gulp.task("assets", function() {
})
gulp.task('js', function() {
return gulp.src(['app.js', "components/**/*"])
return gulp.src(['src/app.js', "src/components/**/*"])
.pipe(babel({
presets: [
['@babel/env', {
@ -70,14 +70,14 @@ gulp.task('js', function() {
gulp.task('js', function() {
let b = browserify({
entries: 'app.js',
entries: 'src/app.js',
debug: false,
transform: [babelify.configure({
presets: ['@babel/preset-env', '@babel/preset-react']
})]
})
return b.bundle()
.pipe(source('app.js'))
.pipe(source('src/app.js'))
.pipe(buffer())
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(gulp.dest('build'))

@ -15,8 +15,6 @@ const Chat = require('./components/chat.js')
// avatar tilt
// incoming/outgoing message alignment (split)
let App = create({
displayName: "App",

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 404 B

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Loading…
Cancel
Save