Last active
February 24, 2018 09:23
-
-
Save mezum/14ce91e9bb648153bfe9aa598e8049ff to your computer and use it in GitHub Desktop.
emcc-loader のチュートリアル用 webpack.config.js
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
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
module.exports = { | |
context: `${__dirname}/src`, | |
entry: { | |
index: './index.ts' | |
}, | |
output: { | |
path: `${__dirname}/dist`, | |
filename: '[name].js' | |
}, | |
resolve: { | |
extensions: [ | |
'.ts', | |
'.js', | |
'.clist' | |
] | |
}, | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
use: 'awesome-typescript-loader' | |
}, | |
{ | |
test: /\.clist$/, | |
use: [ | |
{ | |
loader: 'emcc-loader', | |
options: { | |
buildDir: `${__dirname}/temp`, | |
commonFlags: [ '-g', '-Wall', '-Wextra' ], | |
cFlags: [ '-std=c11' ], | |
cxxFlags: [ '-std=c++14' ], | |
ldFlags: [ '-s', 'DEMANGLE_SUPPORT=1' ] | |
} | |
} | |
] | |
} | |
] | |
}, | |
plugins: [ new HtmlWebpackPlugin() ], | |
externals: { | |
fs: "empty" | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment