From a1ddd164feeb777e21ce79e59676cb272df59cc8 Mon Sep 17 00:00:00 2001 From: Brent Jackson Date: Tue, 19 Jun 2018 11:00:22 -0400 Subject: [PATCH] Move files --- README.md | 13 +++++++++++++ lib/build.js | 4 ++-- lib/config.js | 2 +- lib/dev.js | 2 +- {lib => src}/entry.js | 1 + 5 files changed, 18 insertions(+), 4 deletions(-) rename {lib => src}/entry.js (99%) diff --git a/README.md b/README.md index b2922a6..6efa0c8 100644 --- a/README.md +++ b/README.md @@ -360,3 +360,16 @@ See the [example](https://github.com/c8r/x0/tree/master/examples/webpack-config) [react-loadable]: https://github.com/thejameskyle/react-loadable [webpack-merge]: https://github.com/survivejs/webpack-merge [webpack]: https://webpack.js.org + +--- + +## To Do + +**REMOVE BEFORE MERGING** + +- [ ] deep require context +- [ ] minimatch +- [ ] default route sorting +- [ ] markdown scope +- [ ] move client modules to src +- [ ] adjust resolve diff --git a/lib/build.js b/lib/build.js index e0e8665..4971fbf 100644 --- a/lib/build.js +++ b/lib/build.js @@ -18,7 +18,7 @@ const getApp = opts => { const config = merge(baseConfig, opts.webpack) config.mode = 'development' - config.entry = opts.entry || path.join(__dirname, './entry.js') + config.entry = opts.entry || path.join(__dirname, '../src/entry.js') config.output= { path: opts.tempdir, filename: 'App.js', @@ -191,7 +191,7 @@ module.exports = async (opts) => { if (opts.debug) { config.stats = 'verbose' } - config.entry = path.join(__dirname, './entry') + config.entry = path.join(__dirname, '../src/entry') config.output = { path: opts.outDir, filename: 'bundle.js', diff --git a/lib/config.js b/lib/config.js index f642bd3..7e062d5 100644 --- a/lib/config.js +++ b/lib/config.js @@ -29,7 +29,7 @@ const rules = [ { test: /\.js$/, exclude: path.resolve(__dirname, '../node_modules'), - include: path.resolve(__dirname), + include: path.resolve(__dirname, '..'), loader: require.resolve('babel-loader'), options: babel }, diff --git a/lib/dev.js b/lib/dev.js index c81c5ff..c454811 100644 --- a/lib/dev.js +++ b/lib/dev.js @@ -24,7 +24,7 @@ module.exports = async (opts) => { config.mode = 'development' config.context = opts.dirname - config.entry = opts.entry || path.join(__dirname, './entry') + config.entry = opts.entry || path.join(__dirname, '../src/entry') config.output = { path: path.join(process.cwd(), 'dev'), filename: 'dev.js', diff --git a/lib/entry.js b/src/entry.js similarity index 99% rename from lib/entry.js rename to src/entry.js index 8ab4f23..0606d3e 100644 --- a/lib/entry.js +++ b/src/entry.js @@ -1,3 +1,4 @@ +// Main application import path from 'path' import React from 'react' import { render, hydrate } from 'react-dom'