Skip to content

Commit

Permalink
Add tsconfig.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbruegge committed Apr 15, 2017
1 parent b2b9e2f commit d2b26f0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
14 changes: 14 additions & 0 deletions packages/cycle-scripts/configs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compileOnSave": false,
"compilerOptions":
{
"module": "ES6",
"moduleResolution": "node",
"sourceMap": true,
"jsx" : "preserve",
"target": "ES6"
},
"exclude": [
"node_modules"
]
}
9 changes: 5 additions & 4 deletions packages/cycle-scripts/configs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ process.noDeprecation = true

const webpack2Block = require('@webpack-blocks/webpack2');
const createConfig = webpack2Block.createConfig
const defineConstants = webpack2Block.defineConstant
const defineConstants = webpack2Block.defineConstants
const env = webpack2Block.env
const entryPoint = webpack2Block.entryPoint
const setOutput = webpack2Block.setOutput
Expand Down Expand Up @@ -51,11 +51,11 @@ const babelConfig = {
}

module.exports = function(language) {
const ending = language === 'javascript' ? 'js' : 'ts'
const ending = language === 'javascript' ? '.js' : '.ts'
const baseConfig = [
entryPoint(path.join(process.cwd(), 'src', 'index' + ending)),
setOutput(path.join(process.cwd(), 'build', 'bundle.[hash].js')),
babel(),
babel(babelConfig),
defineConstants({
'process.env.NODE_ENV': process.env.NODE_ENV
}),
Expand Down Expand Up @@ -85,8 +85,9 @@ module.exports = function(language) {
const config = language === 'javascript' ? baseConfig : baseConfig
.concat([
typescript({
tsconfig: path.join(__dirname, 'tsconfig.json'),
useBabel: true,
babelOptions: baseConfig,
babelOptions: babelConfig,
useCache: true,
cacheDirectory: 'node_modules/.cache/at-loader'
}),
Expand Down
Empty file modified packages/cycle-scripts/index.js
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion packages/cycle-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function run (port) {
}
)

const devServer = new WebpackDevServer(compiler, devServerConfig)
const devServer = new WebpackDevServer(compiler)

devServer.listen(port, err => {
if (err) {
Expand Down

0 comments on commit d2b26f0

Please sign in to comment.