This repository has been archived by the owner on Oct 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swapping build to webpack + crossbow
- Loading branch information
Shane Osbourne
committed
Aug 19, 2015
1 parent
19edd83
commit b158159
Showing
11 changed files
with
748 additions
and
702 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
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,51 @@ | ||
/** | ||
* Require Browsersync along with webpack and middleware for it | ||
*/ | ||
var webpack = require('webpack'); | ||
var webpackDevMiddleware = require('webpack-dev-middleware'); | ||
var webpackHotMiddleware = require('webpack-hot-middleware'); | ||
|
||
/** | ||
* Require ./webpack.config.js and make a bundler from it | ||
*/ | ||
var webpackConfig = require('./webpack.config'); | ||
|
||
webpackConfig.plugins = webpackConfig.plugins = [ | ||
new webpack.optimize.OccurenceOrderPlugin(), | ||
new webpack.HotModuleReplacementPlugin(), | ||
new webpack.NoErrorsPlugin() | ||
]; | ||
|
||
webpackConfig.debug = true; | ||
webpackConfig.devtool = "#eval-source-map"; | ||
webpackConfig.entry = webpackConfig.entry.concat([ | ||
'webpack/hot/dev-server', | ||
'webpack-hot-middleware/client', | ||
]); | ||
|
||
var bundler = webpack(webpackConfig); | ||
|
||
/** | ||
* Run Browsersync and use middleware for Hot Module Replacement | ||
*/ | ||
module.exports = { | ||
server: 'test/fixtures', | ||
//watchOptions: { | ||
// usePolling: true | ||
//}, | ||
plugins: ['/Users/shaneobsourne/code/UI'], | ||
middleware: [ | ||
webpackDevMiddleware(bundler, { | ||
// IMPORTANT: dev middleware can't access config, so we should | ||
// provide publicPath by ourselves | ||
publicPath: webpackConfig.output.publicPath, | ||
|
||
// pretty colored output | ||
stats: { colors: true } | ||
|
||
// for other settings see | ||
// http://webpack.github.io/docs/webpack-dev-middleware.html | ||
}), | ||
webpackHotMiddleware(bundler) | ||
] | ||
}; |
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,9 @@ | ||
watch: | ||
tasks: | ||
default: | ||
"src/scss/**": ["sass"] | ||
|
||
config: | ||
sass: | ||
input: "src/scss/core.scss" | ||
output: "public/css/core.min.css" |
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,7 @@ | ||
var bs = require('browser-sync').create(); | ||
bs.use(require('./')); | ||
|
||
bs.init({ | ||
server: 'test/fixtures', | ||
open: false | ||
}); |
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
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
Oops, something went wrong.