-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DAVID♥
committed
Mar 5, 2017
1 parent
0b5334c
commit e25b590
Showing
3 changed files
with
112 additions
and
43 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,38 @@ | ||
/** | ||
* Require Browsersync along with webpack and middleware for it | ||
*/ | ||
let browserSync = require('browser-sync').create(); | ||
let webpack = require('webpack'); | ||
let webpackDevMiddleware = require('webpack-dev-middleware'); | ||
let webpackHotMiddleware = require('webpack-hot-middleware'); | ||
let webpackConfig = require('./webpack.config.js'); | ||
/** | ||
* Require ./webpack.config.js and make a bundler from it | ||
*/ | ||
const bsPort = 3000; | ||
webpackConfig.watch = false; | ||
webpackConfig.output.publicPath = `http://localhost:${bsPort}/ps/themes/classic/assets/js/` // url to webpack output path | ||
|
||
let bundler = webpack(webpackConfig); | ||
|
||
/** | ||
* Run Browsersync and use middleware for Hot Module Replacement | ||
*/ | ||
browserSync.init({ | ||
open: true | ||
, port: bsPort | ||
, proxy: { | ||
target: `http://localhost:88` //host your local webserver | ||
} | ||
, src: [`./templates/**/*.tpl`, `./modules/**/*.tpl`] // full page reload if .tpl file changed | ||
, middleware: [ | ||
webpackDevMiddleware( bundler, { | ||
// IMPORTANT: dev middleware can't access config, so we should | ||
// provide publicPath by ourselves | ||
publicPath: webpackConfig.output.publicPath | ||
, stats: { colors: true , chunck : false} | ||
, hot: true | ||
} ), | ||
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 |
---|---|---|
@@ -1,35 +1,41 @@ | ||
{ | ||
"name": "prestashop-starter-theme-dev-tools", | ||
"version": "0.0.1", | ||
"description": "Tools to help while developing the starter theme", | ||
"main": "index.js", | ||
"scripts": { | ||
"watch": "webpack -w", | ||
"build": "webpack" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"babel-loader": "^5.3.2", | ||
"bootstrap": "4.0.0-alpha.4", | ||
"bootstrap-touchspin": "^3.1.1", | ||
"bourbon": "^4.2.6", | ||
"css-loader": "^0.23.1", | ||
"expose-loader": "^0.7.1", | ||
"extract-text-webpack-plugin": "^1.0.0", | ||
"file-loader": "^0.8.5", | ||
"flexibility": "^1.0.5", | ||
"jquery": "^2.1.4", | ||
"material-design-icons": "^2.1.3", | ||
"node-sass": "^3.4.2", | ||
"open-sans-fontface": "1.4.0", | ||
"postcss-flexibility": "^1.0.2", | ||
"postcss-loader": "^0.8.0", | ||
"sass-loader": "^3.1.2", | ||
"style-loader": "^0.13.0", | ||
"tether": "^1.1.1", | ||
"velocity-animate": "^1.2.3", | ||
"webpack": "^1.12.9", | ||
"webpack-sources": "^0.1.0" | ||
} | ||
} | ||
"name": "prestashop-starter-theme-dev-tools" | ||
, "version": "0.0.1" | ||
, "description": "Tools to help while developing the starter theme" | ||
, "main": "index.js" | ||
, "scripts": { | ||
"hot": "node ./hot.webpack.js" | ||
, "watch": "webpack -w" | ||
, "build": "webpack" | ||
} | ||
, "author": "" | ||
, "license": "ISC" | ||
, "devDependencies": { | ||
"babel-loader": "5.3.2" | ||
, "bootstrap": "4.0.0-alpha.4" | ||
, "bootstrap-touchspin": "3.1.1" | ||
, "bourbon": "^4.2.6" | ||
, "browser-sync": "2.18.8" | ||
, "css-loader": "0.23.1" | ||
, "expose-loader": "0.7.1" | ||
, "extract-text-webpack-plugin": "1.0.0" | ||
, "file-loader": "0.8.5" | ||
, "flexibility": "1.0.5" | ||
, "jquery": "2.1.4" | ||
, "material-design-icons": "2.1.3" | ||
, "monkey-hot-loader": "0.0.3" | ||
, "node-sass": "3.4.2" | ||
, "open-sans-fontface": "1.4.0" | ||
, "postcss-flexibility": "1.0.2" | ||
, "postcss-loader": "0.8.0" | ||
, "rimraf": "2.6.1" | ||
, "sass-loader": "3.1.2" | ||
, "style-loader": "0.13.0" | ||
, "tether": "1.1.1" | ||
, "velocity-animate": "1.2.3" | ||
, "webpack": "1" | ||
, "webpack-dev-middleware": "1.10.1" | ||
, "webpack-hot-middleware": "2.17.1" | ||
, "webpack-sources": "0.1.0" | ||
} | ||
} |
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