diff --git a/.eslintrc.json b/.eslintrc similarity index 100% rename from .eslintrc.json rename to .eslintrc diff --git a/.stylelintrc.json b/.stylelintrc similarity index 100% rename from .stylelintrc.json rename to .stylelintrc diff --git a/README.md b/README.md index 1642515..67a8600 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/package.json b/package.json index 44b4f6e..f7fb69f 100644 --- a/package.json +++ b/package.json @@ -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", @@ -39,6 +39,5 @@ "stylelint-webpack-plugin": "^0.10.5", "webpack": "^4.28.4", "webpack-cli": "^3.2.1" - }, - "dependencies": {} + } } diff --git a/webpack.config.js b/webpack.config.js index 6a83225..c31798a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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: [ { @@ -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') } }, {