Skip to content

Commit 7029422

Browse files
committed
chore: move build config into a separate directory
1 parent 31d6b88 commit 7029422

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"email": "[email protected]"
1515
},
1616
"scripts": {
17-
"dev": "webpack-dev-server --hot --info=false --port 8000",
18-
"build": "NODE_ENV=production webpack -p --progress --hide-modules",
17+
"dev": "webpack-dev-server --config scripts/webpack.config.js --hot --info=false --port 8000",
18+
"build": "NODE_ENV=production webpack --config scripts/webpack.config.js -p --progress --hide-modules",
1919
"lint": "eslint -f friendly --ext .js,.vue ./",
20-
"test": "BABEL_ENV=test karma start",
20+
"test": "BABEL_ENV=test karma start scripts/karma.conf.js",
2121
"precommit": "npm run lint",
2222
"commitmsg": "commitlint -E GIT_PARAMS",
23-
"release": "bash ./release.sh"
23+
"release": "bash ./scripts/release.sh"
2424
},
2525
"keywords": [
2626
"vue",
@@ -116,7 +116,6 @@
116116
"eslintIgnore": [
117117
"dist",
118118
"test/unit/coverage",
119-
"karma.conf.js",
120-
"webpack.config.js"
119+
"scripts"
121120
]
122121
}

karma.conf.js renamed to scripts/karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module.exports = function(config) {
77
config.set({
88
frameworks: ['mocha', 'sinon-chai'],
99
files: [
10-
'./test/unit/index.js'
10+
'../test/unit/index.js'
1111
],
1212
preprocessors: {
13-
'./test/unit/index.js': 'webpack'
13+
'../test/unit/index.js': 'webpack'
1414
},
1515
browsers: ['PhantomJS'],
1616
reporters: ['spec', 'coverage'],
1717
coverageReporter: {
18-
dir: './test/unit/coverage',
18+
dir: '../test/unit/coverage',
1919
reporters: [
2020
{ type: 'lcov', subdir: '.' },
2121
{ type: 'text-summary' }
File renamed without changes.

webpack.config.js renamed to scripts/webpack.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'vue-infinite-loading': './src/index.js'
99
},
1010
output: {
11-
path: path.join(__dirname, './dist'),
11+
path: path.join(__dirname, '../dist'),
1212
filename: '[name].js',
1313
publicPath: '/',
1414
library: 'VueInfiniteLoading',
@@ -25,15 +25,15 @@ module.exports = {
2525
{
2626
test: /\.(vue|js)$/,
2727
enforce: 'pre',
28-
include: [path.join(__dirname, './src'), path.join(__dirname, './test')],
28+
include: [path.join(__dirname, '../src'), path.join(__dirname, '../test')],
2929
loader: 'eslint-loader',
3030
options: {
3131
formatter: require('eslint-formatter-friendly')
3232
}
3333
},
3434
{
3535
test: /\.js$/,
36-
include: [path.join(__dirname, './src'), path.join(__dirname, './test')],
36+
include: [path.join(__dirname, '../src'), path.join(__dirname, '../test')],
3737
loader: 'babel-loader',
3838
options: {
3939
presets: ['@babel/preset-env'],
@@ -82,7 +82,7 @@ module.exports = {
8282

8383
if (process.env.NODE_ENV === 'production') {
8484
// production configurations
85-
const pkg = require('./package');
85+
const pkg = require('../package');
8686
const banner = [
8787
`${pkg.name} v${process.env.VERSION || pkg.version}`,
8888
`(c) 2016-${new Date().getFullYear()} ${pkg.author.name}`,

0 commit comments

Comments
 (0)