Skip to content

Commit

Permalink
Merge pull request #6 from punkave/feature/0.1.0
Browse files Browse the repository at this point in the history
Feature/0.1.0
  • Loading branch information
grdunn authored Feb 1, 2019
2 parents 4375c39 + f3d3acd commit 35ae0fd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
File renamed without changes.
File renamed without changes.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ webpack-dev.js
...
const pkWebpack = require('pk-webpack');
const path = require('path');
const appRoot = path.resolve(__dirname, './');
pkWebpack(
{
'appRoot': appRoot,
'env': 'dev'
}
);
const appRoot = path.resolve(__dirname, '../');
const config = {
'mode': 'development'
};
pkWebpack(appRoot, config);
```

This initializes Webpack with the proper dev environment, and passes along the root of the project for proper "build" context. In other words, it gives Webpack knowledge of where to look for, and compile assets. "env" could either be `dev` or `prod`, depending on the context and the file that you're in.
This initializes Webpack with the proper dev environment, and passes along the root of the project for proper "build" context. In other words, it gives Webpack knowledge of where to look for, and compile assets. "mode" could either be `development` or `production`, depending on the context and the file that you're in. This gets merged with Webpack's standard configuration object, so you can pass other parameters here as well.

4. `pk-webpack` will look inside your `src` folder for javascript, and sass files within `js`, and `scss` folders respectively. Following best practices, the entry points are `/src/js/site.js` and `/src/scss/site.scss`.

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"author": "",
"license": "ISC",
"devDependencies": {
"dependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.7.0",
Expand Down Expand Up @@ -39,6 +39,5 @@
"stylelint-webpack-plugin": "^0.10.5",
"webpack": "^4.28.4",
"webpack-cli": "^3.2.1"
},
"dependencies": {}
}
}
11 changes: 2 additions & 9 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,9 @@ module.exports = function (appRoot) {
}),
new StyleLintPlugin({
failOnError: false,
configFile: path.join(__dirname, './.stylelintrc.json')
configFile: path.join(__dirname, './.stylelintrc')
})
],
resolve: {
modules: [ path.join(__dirname, 'node_modules') ]
},
resolveLoader: {
modules: [ path.join(__dirname, 'node_modules') ],
extensions: [ '.js', '.json' ]
},
module: {
rules: [
{
Expand All @@ -42,7 +35,7 @@ module.exports = function (appRoot) {
exclude: /node_modules/,
loader: 'eslint-loader',
options: {
configFile: path.join(__dirname, './.eslintrc.json')
configFile: path.join(__dirname, './.eslintrc')
}
},
{
Expand Down

0 comments on commit 35ae0fd

Please sign in to comment.