This repository has been archived by the owner on Mar 1, 2019. It is now read-only.
-
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.
Merge pull request #56 from wmde/config-cs
Configuration code style
- Loading branch information
Showing
9 changed files
with
139 additions
and
132 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/app' | ||
] | ||
} | ||
presets: [ | ||
'@vue/app', | ||
], | ||
}; |
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,31 +1,31 @@ | ||
module.exports = { | ||
globals: { | ||
'ts-jest': { | ||
tsConfigFile: './tsconfig.all.json', | ||
}, | ||
}, | ||
moduleFileExtensions: [ | ||
'js', | ||
'jsx', | ||
'json', | ||
'vue', | ||
'ts', | ||
'tsx' | ||
], | ||
transform: { | ||
'^.+\\.vue$': 'vue-jest', | ||
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', | ||
'^.+\\.tsx?$': 'ts-jest' | ||
}, | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$1' | ||
}, | ||
setupTestFrameworkScriptFile: '<rootDir>/tests/config/setup.ts', | ||
snapshotSerializers: [ | ||
'jest-serializer-vue' | ||
], | ||
testMatch: [ | ||
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' | ||
], | ||
testURL: 'http://localhost/' | ||
globals: { | ||
'ts-jest': { | ||
tsConfigFile: './tsconfig.all.json', | ||
}, | ||
}, | ||
moduleFileExtensions: [ | ||
'js', | ||
'jsx', | ||
'json', | ||
'vue', | ||
'ts', | ||
'tsx', | ||
], | ||
transform: { | ||
'^.+\\.vue$': 'vue-jest', | ||
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', | ||
'^.+\\.tsx?$': 'ts-jest', | ||
}, | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$1', | ||
}, | ||
setupTestFrameworkScriptFile: '<rootDir>/tests/config/setup.ts', | ||
snapshotSerializers: [ | ||
'jest-serializer-vue', | ||
], | ||
testMatch: [ | ||
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)', | ||
], | ||
testURL: 'http://localhost/', | ||
}; |
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,10 +1,10 @@ | ||
{ | ||
"--title": "Wikibase Termbox - Documentation", | ||
"--output": "docs", | ||
"--processes": "0", | ||
"--warnings-exit-nonzero": true, | ||
"--builtin-classes": true, | ||
"--warnings": ["-all"], | ||
"--": [ | ||
] | ||
"--title": "Wikibase Termbox - Documentation", | ||
"--output": "docs", | ||
"--processes": "0", | ||
"--warnings-exit-nonzero": true, | ||
"--builtin-classes": true, | ||
"--warnings": ["-all"], | ||
"--": [ | ||
] | ||
} |
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,5 +1,5 @@ | ||
module.exports = { | ||
plugins: { | ||
autoprefixer: {} | ||
} | ||
} | ||
plugins: { | ||
autoprefixer: {}, | ||
}, | ||
}; |
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
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 |
---|---|---|
@@ -1,53 +1,53 @@ | ||
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin') | ||
const VueSSRClientPlugin = require('vue-server-renderer/client-plugin') | ||
const VueSSRServerPlugin = require( 'vue-server-renderer/server-plugin' ); | ||
const VueSSRClientPlugin = require( 'vue-server-renderer/client-plugin' ); | ||
|
||
const TARGET_NODE = process.env.WEBPACK_TARGET === 'node' | ||
const DEV_MODE = process.env.WEBPACK_TARGET === 'dev' | ||
const filePrefix = 'wikibase.termbox.' | ||
const TARGET_NODE = process.env.WEBPACK_TARGET === 'node'; | ||
const DEV_MODE = process.env.WEBPACK_TARGET === 'dev'; | ||
const filePrefix = 'wikibase.termbox.'; | ||
|
||
const target = TARGET_NODE | ||
? 'server' | ||
: 'client' | ||
? 'server' | ||
: 'client'; | ||
|
||
module.exports = { | ||
outputDir: TARGET_NODE ? 'serverDist' : 'dist', | ||
configureWebpack: () => ({ | ||
entry: DEV_MODE ? [ './src/mockup-entry.ts', `./src/${target}-entry.ts` ] : `./src/${target}-entry.ts`, | ||
target: TARGET_NODE ? 'node' : 'web', | ||
node: TARGET_NODE ? undefined : false, | ||
plugins: [ | ||
TARGET_NODE | ||
? new VueSSRServerPlugin() | ||
: new VueSSRClientPlugin() | ||
], | ||
output: { | ||
libraryTarget: TARGET_NODE | ||
? 'commonjs2' | ||
: undefined, | ||
filename: `${filePrefix}[name].js` | ||
}, | ||
optimization: { | ||
splitChunks: undefined | ||
} | ||
}), | ||
chainWebpack: config => { | ||
config.optimization.delete('splitChunks') | ||
outputDir: TARGET_NODE ? 'serverDist' : 'dist', | ||
configureWebpack: () => ( { | ||
entry: DEV_MODE ? [ './src/mockup-entry.ts', `./src/${target}-entry.ts` ] : `./src/${target}-entry.ts`, | ||
target: TARGET_NODE ? 'node' : 'web', | ||
node: TARGET_NODE ? undefined : false, | ||
plugins: [ | ||
TARGET_NODE | ||
? new VueSSRServerPlugin() | ||
: new VueSSRClientPlugin(), | ||
], | ||
output: { | ||
libraryTarget: TARGET_NODE | ||
? 'commonjs2' | ||
: undefined, | ||
filename: `${filePrefix}[name].js`, | ||
}, | ||
optimization: { | ||
splitChunks: undefined, | ||
}, | ||
} ), | ||
chainWebpack: config => { | ||
config.optimization.delete( 'splitChunks' ); | ||
|
||
if ( process.env.NODE_ENV === 'production' ) { | ||
config.plugin('extract-css') | ||
.tap(([options, ...args]) => [ | ||
Object.assign({}, options, { filename: `${filePrefix}[name].css` }), | ||
...args | ||
]) | ||
} | ||
if ( process.env.NODE_ENV === 'production' ) { | ||
config.plugin( 'extract-css' ) | ||
.tap( ( [ options, ...args ] ) => [ | ||
Object.assign( {}, options, { filename: `${filePrefix}[name].css` } ), | ||
...args, | ||
] ); | ||
} | ||
|
||
config.module | ||
.rule('vue') | ||
.use('vue-loader') | ||
.tap(options => | ||
Object.assign(options, { | ||
optimizeSSR: false | ||
}) | ||
) | ||
} | ||
} | ||
config.module | ||
.rule( 'vue' ) | ||
.use( 'vue-loader' ) | ||
.tap( options => | ||
Object.assign( options, { | ||
optimizeSSR: false, | ||
} ), | ||
); | ||
}, | ||
}; |