Skip to content

Instantly share code, notes, and snippets.

@mezum
Last active February 24, 2018 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mezum/14ce91e9bb648153bfe9aa598e8049ff to your computer and use it in GitHub Desktop.
Save mezum/14ce91e9bb648153bfe9aa598e8049ff to your computer and use it in GitHub Desktop.
emcc-loader のチュートリアル用 webpack.config.js
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