-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Webpack config refactor; CSS now generated with HTML (#253)
* Build refactor; CSS generated with static step * 'build-spa' -> 'build-javascript' * Simplify build-javascript pass-through callback * Split third stage into: build-css and build-html Because webpack will always generate a final javascript file, the 'build-css' stage isn't as clean as I'd like it.
- Loading branch information
1 parent
11b2bd9
commit a87cb38
Showing
6 changed files
with
139 additions
and
63 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import webpack from 'webpack' | ||
import webpackConfig from './webpack.config' | ||
import fs from 'fs' | ||
|
||
module.exports = (program, callback) => { | ||
const { directory } = program | ||
|
||
const compilerConfig = webpackConfig(program, directory, 'build-css') | ||
|
||
return webpack(compilerConfig.resolve()).run((err, stats) => { | ||
// We don't want any javascript produced by this step in the process. | ||
fs.unlinkSync(`${directory}/public/bundle-for-css.js`) | ||
|
||
return callback(err, stats) | ||
}) | ||
} |
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,10 @@ | ||
import webpack from 'webpack' | ||
import webpackConfig from './webpack.config' | ||
|
||
module.exports = (program, callback) => { | ||
const { directory } = program | ||
|
||
const compilerConfig = webpackConfig(program, directory, 'build-javascript') | ||
|
||
return webpack(compilerConfig.resolve()).run(callback) | ||
} |
This file was deleted.
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
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